Open aherrmann opened 6 years ago
I believe n-t-tcp is only meant to support IPv4 addresses this far. That doesn't mean that it couldn't be enhanced if your project needs it.
The project doesn't need IPv6, so passing 127.0.0.1
instead of localhost
is a viable work-around.
Forgot to mention: I tried passing hints with addrFamily = AF_INET
in the above mentioned location to force getAddrInfo
to return an IPv4 address, but it caused the program to hang.
Note that the loopback interface does not always have address 127.0.0.1 on all systems.
I'm observing failures when trying to connect and send messages to
localhost
:I did not construct a minimal example, but I've traced the issue to the following commit to
network-transport-tcp
. In particular the original failure occurs in this line. The issue is that at this pointsockAddr
has the value::1
butdecodeSockAddr
only supports IPv4 addresses. Adding a dummy case that handles IPv6 and always returns127.0.0.1:<port>
fixes the connection failures in my case. The IPv6 address originates from this call toN.getAddrInfo
whenhost="localhost"
. A work-around is to always use127.0.0.1
instead oflocalhost
. This depends on system configuration, as the issue was only observed on some machines.