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
Affected versions
Tested on OTP 28 RC1, current master. Likely affects previous versions since 24.3 (commit 94e68e5).
Additional context
I was trying to understand if #5044 was solved by the OTP 24.3 change to gen_tcp:connect/3. I'm not sure if I'm doing something wrong, but I can't get it to work with loopback.
From the stack strace, inet_tcp:do_connect doesn't have a clause for the atoms. It only matches {A,B,C,D} tuples (IP address).
This is called from inet_tcp:connect after gen_tcp:connect2 in:
Describe the bug
gen_tcp:connect/3
fails whenaddr
in theSockAddr
map isloopback
.To Reproduce
Open a listening socket:
Open a TCP connection to
loopback
, from Erlang:Expected behavior
gen_tcp:connect/3
should work with asockaddr_in()
whenaddr
isloopback
.Affected versions
Tested on OTP 28 RC1, current master. Likely affects previous versions since 24.3 (commit 94e68e5).
Additional context
I was trying to understand if #5044 was solved by the OTP 24.3 change to
gen_tcp:connect/3
. I'm not sure if I'm doing something wrong, but I can't get it to work withloopback
.From the stack strace,
inet_tcp:do_connect
doesn't have a clause for the atoms. It only matches{A,B,C,D}
tuples (IP address).This is called from
inet_tcp:connect
aftergen_tcp:connect2
in:otp/lib/kernel/src/gen_tcp.erl
Lines 598 to 600 in 03b6047
I can solve the problem by calling
inet:translate_ip/2
beforeMod:connect
inconnect2
, but I'm not sure if this is the correct way to fix it.If it is a bug, I would like to work on a PR, including documentation and tests if needed. I may need some guidance on the correct way of fixing it.
The text was updated successfully, but these errors were encountered: