A. S. Bradbury
9/7/2006 2:04:00 PM
On Monday 04 September 2006 03:27, Eric Hodel wrote:
> Can you try:
>
> require 'socket'
>
> p Socket.getaddrinfo(nil, 80, Socket::AF_UNSPEC,
> Socket::SOCK_STREAM, 0, Socket::AI_PASSIVE)
>
> On an IPv6 capable machine I get:
>
> [["AF_INET6", 80, "::", "::", 30, 1, 6], ["AF_INET", 80, "0.0.0.0",
> "0.0.0.0", 2, 1, 6]]
>
> and on an IPv4 only machine I get:
>
> [["AF_INET", 80, "0.0.0.0", "0.0.0.0", 2, 1, 6]]
On my ipv4 machine I get:
SocketError: getnameinfo: ai_family not supported
from (irb):4:in `getaddrinfo'
from (irb):4
On the ipv4 machine with gentoo's ebuild of ruby compiled with the ipv6 USE
flag I get similar output to yours. I wonder if this is something broken on
my systems, a ruby issue, or a packaging issue.
Alex