when I try to connect with TCPSocket.new, I get an Errno::EAFNOSUPPORT for timeout (i.e. the remote site fails to respond)
and connection refused (no server on that port on the remote side). I would have expected to get the same errors than
#connect (i.e. ETIMEOUT and ECONNREFUSED)
This is related to ipv6: the host I'm trying to connect to has both ipv4 and ipv6 addresses, but I can connect only
using the IPv4 one. Since that connect fails, init_inetsock_internal tries the IPv6 address, which fails since I disabled
ipv6 handling on my machine.
Even if I enable IPv6, I get
SocketError: getaddrinfo: Servname not supported for ai_socktype
since the source address is IPv4 (I have no IPv6 link to the target machine).
I think that in both cases, we should get the proper connect() error. This is not a big deal for now, but it will become
a problem as mixed ipv4-ipv6 environments will be common. |