From: Eric Hodel Date: 2003-01-23T00:56:03+09:00 Subject: Re: TCPServer only binding to INET6 interfaces? --XzY9riSyYkvFozeP Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Jason DiCioccio (geniusj@bluenugget.net) wrote: > Under FreeBSD 5.0-RELEASE running ruby 1.6.8, the following code: >=20 > ---- > require 'socket' >=20 > server =3D TCPServer.new(9999) > client =3D server.accept > ---- >=20 > only seems to bind to port 9999 on ipv6 interfaces. >=20 > % netstat -an | grep 9999 > tcp6 0 0 *.9999 *.* LISTEN > % >=20 > It works, however, when I specify a host to bind to. It only fails when= =20 > trying to use INADDR_ANY.. >=20 > I cannot tell for sure whether this is due to changes in FreeBSD, ruby, o= r=20 > a combination of both. However, my guess would be ruby since I have many= =20 > daemons binding to INADDR_ANY and running fine. Is anyone else running B= SD=20 > (or perhaps other OS') with IPv6 support still in the kernel able to=20 > duplicate this problem? What addresses does ruby claim to be listening on? I don't believe the IPv6 stuff is significantly different than -STABLE's. $ ruby -r socket -e "p TCPServer.new(9999).peeraddr" ["AF_INET6", 9999, "::ffff:0.0.0.0", "::ffff:0.0.0.0"] This is on STABLE, if I get a chance I'll fire up my CURRENT box tonight. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --XzY9riSyYkvFozeP Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE+Lr8QMypVHHlsnwQRAuKuAJ4k/waN+Y4bcXF68jEdxA2cv63F0QCfWlZU LcvrvZ7IqKzNA28+Tmsx6NQ= =DMcn -----END PGP SIGNATURE----- --XzY9riSyYkvFozeP--