From: Tanaka Akira Date: 2011-11-01T20:39:41+09:00 Subject: [ruby-core:40620] Re: [ruby-trunk - Bug #5525] UDPSocket#bind(ip, port) fails under IPv6 => Errno::EAFNOSUPPORT 2011/11/1 I�aki Baz Castillo : > > Thanks a lot. But why is it required just for UDP? In TCP I can use "TCPServer.new some_ipv6, port" with no problem. Why UDPSocket requires special handling for IPv6? The protocol (IPv4/IPv6) is determined at socket creation. The argument of TCPServer.new(ipv6_address) makes Ruby to find that the protocol is IPv6. So TCPServer.new creates a socket for IPv6. But Ruby cannot find the protocol for UDPSocket.new without arguments. In that case, UDPScoket.new creates a socket for IPv4. You meet an error when you use it for IPv6. -- Tanaka Akira