-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
raw option doesn't work gen_tcp when the socket backend is enabled (otp 24) #5122
Comments
It seems that I refactored code when implementing That code refactoring causes your raw option I want to take a more thorough look at option handling in gen_tcp_socket, to see how to make it less messy... |
This should be the smallest possible and probably correct fix: diff --git a/lib/kernel/src/gen_tcp_socket.erl b/lib/kernel/src/gen_tcp_socket.erl
index 1841623241..5125bc4997 100644
--- a/lib/kernel/src/gen_tcp_socket.erl
+++ b/lib/kernel/src/gen_tcp_socket.erl
@@ -316,8 +316,8 @@ listen_open(Domain, ListenOpts, Opts, ExtraOpts, Backlog, BindAddr) ->
[{start_opts, StartOpts}] ++ SocketOpts ++ Setopts_1),
ErrRef = make_ref(),
try
- ok(ErrRef, call_bind(Server, default_any(Domain, BindAddr))),
ok(ErrRef, call(Server, {setopts, Setopts})),
+ ok(ErrRef, call_bind(Server, default_any(Domain, BindAddr))),
Socket = val(ErrRef, call(Server, {listen, Backlog})),
{ok, ?MODULE_socket(Server, Socket)}
catch |
thanks for your reply,I will check those fix codes。 |
…OTP-17580' into maint * raimo/kernel/inet-backend-socket-option-parsing/GH-5122/OTP-17580: Further simplify option parsing Comment out currently dead code due to Dialyzer Fix tests for inet_backend = socket Rewrite option parsing to less messy
Fix merged |
I believe these symptoms have reappeared in OTP 26 (at least broken on 26.1.2). See: ninenines/ranch#216 (comment) |
Describe the bug
https://bugs.erlang.org/browse/ERL-1287
this bug was fixed in otp 23.1, but happen again in otp 24, It cann't listening multiple sockets on the same port.
To Reproduce
Expected behavior
I test in otp 23.3 with no error
Affected versions
Erlang/OTP 24 [erts-12.0.3]
The text was updated successfully, but these errors were encountered: