Bugs: Browse | Submit New | Admin

[#12811] TCPSocket.new raises Errno::EAFNOSUPPORT regardless of the actual error

Date:
2007-08-04 09:54
Priority:
3
Submitted By:
Sylvain Joyeux (lapinot)
Assigned To:
Akinori MUSHA (knu)
Category:
Network / Comm / Protocols
State:
Open
Platform:
 
Summary:
TCPSocket.new raises Errno::EAFNOSUPPORT regardless of the actual error

Detailed description
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.

Add A Comment: Notepad

Please login


Followup

Message
Date: 2008-11-08 01:17
Sender: Roger Pack

this may be OS dependent.  If not then please post to redmine :)
-=R

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item