[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ipv6 connection attempted before ipv4

snacktime

10/30/2006 1:29:00 AM

I've noticed that when using net/http, and probably with any ip/udp
socket connection, it attempts to connect via ipv6 and when that fails
it falls back to ipv4. Is this due to the underlying socket library
on freebsd, or is it a ruby issue? Both client and server are
freebsd.

Chris

3 Answers

snacktime

10/30/2006 1:37:00 AM

0

On 10/29/06, snacktime <snacktime@gmail.com> wrote:
> I've noticed that when using net/http, and probably with any ip/udp
> socket connection, it attempts to connect via ipv6 and when that fails
> it falls back to ipv4. Is this due to the underlying socket library
> on freebsd, or is it a ruby issue? Both client and server are
> freebsd.

Forgot to mention this was when using 'localhost' instead of
127.0.0.1. For anyone else testing clients/servers on freebsd, don't
use 'localhost', use 127.0.0.1. Freebsd limits RST packets to so many
per second, and it took me a little bit to figure out why my http
connections were hanging for a second after every 200. Not sure if
linux has the same behavior.

Chris

Garance A Drosehn

10/30/2006 2:29:00 AM

0

On 10/29/06, snacktime <snacktime@gmail.com> wrote:
> On 10/29/06, snacktime <snacktime@gmail.com> wrote:
> > I've noticed that when using net/http, and probably with any ip/udp
> > socket connection, it attempts to connect via ipv6 and when that fails
> > it falls back to ipv4. Is this due to the underlying socket library
> > on freebsd, or is it a ruby issue?
>
> Forgot to mention this was when using 'localhost' instead of
> 127.0.0.1. For anyone else testing clients/servers on freebsd, don't
> use 'localhost', use 127.0.0.1.

It has to do with the order of 'localhost' lines in the /etc/hosts file.

--
Garance Alistair Drosehn = drosihn@gmail.com
Senior Systems Programmer
Rensselaer Polytechnic Institute; Troy, NY; USA

snacktime

10/30/2006 3:01:00 AM

0

On 10/29/06, Garance A Drosehn <drosihn@gmail.com> wrote:
> On 10/29/06, snacktime <snacktime@gmail.com> wrote:
> > On 10/29/06, snacktime <snacktime@gmail.com> wrote:
> > > I've noticed that when using net/http, and probably with any ip/udp
> > > socket connection, it attempts to connect via ipv6 and when that fails
> > > it falls back to ipv4. Is this due to the underlying socket library
> > > on freebsd, or is it a ruby issue?
> >
> > Forgot to mention this was when using 'localhost' instead of
> > 127.0.0.1. For anyone else testing clients/servers on freebsd, don't
> > use 'localhost', use 127.0.0.1.
>
> It has to do with the order of 'localhost' lines in the /etc/hosts file.

Ah I didn't even notice that. Makes sense now.