You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On operating systems that support it, the SO_REUSEPORT option can be used to have multiple sockets listening on the same port. On Linux, for example, this can be enabled with the raw option \{raw, 1, 15, <<1:32>>} (different in other OSes).
While this works with the inet backend:
{code:java}
1> gen_tcp:listen(0, [{inet_backend, inet}, {port, 8888}, {raw, 1, 15, <<1:32>>}]).
{ok,#Port<0.8>}
2> gen_tcp:listen(0, [{inet_backend, inet}, {port, 8888}, {raw, 1, 15, <<1:32>>}]).
{ok,#Port<0.9>}
{code}
... it does not work when the socket backend is used:
{code:java}
1> gen_tcp:listen(0, [{inet_backend, socket}, {port, 8888}, {raw, 1, 15, <<1:32>>}]).
{ok,{'$inet',gen_tcp_socket,
{<0.95.0>,{'$socket',#Ref<0.147054778.119668737.117952>}}}}
2> gen_tcp:listen(0, [{inet_backend, socket}, {port, 8888}, {raw, 1, 15, <<1:32>>}]).
{error,eaddrinuse}
{code}
The text was updated successfully, but these errors were encountered:
Original reporter:
juhlig
Affected version:
OTP-23.0.2
Fixed in version:
OTP-23.1
Component:
inet
Migrated from: https://bugs.erlang.org/browse/ERL-1287
The text was updated successfully, but these errors were encountered: