ipv6 connection attempted before ipv4

Discussion in 'Ruby' started by snacktime, Oct 30, 2006.

  1. snacktime

    snacktime Guest

    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
    snacktime, Oct 30, 2006
    #1
    1. Advertising

  2. snacktime

    snacktime Guest

    On 10/29/06, snacktime <> 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
    snacktime, Oct 30, 2006
    #2
    1. Advertising

  3. On 10/29/06, snacktime <> wrote:
    > On 10/29/06, snacktime <> 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 =
    Senior Systems Programmer
    Rensselaer Polytechnic Institute; Troy, NY; USA
    Garance A Drosehn, Oct 30, 2006
    #3
  4. snacktime

    snacktime Guest

    On 10/29/06, Garance A Drosehn <> wrote:
    > On 10/29/06, snacktime <> wrote:
    > > On 10/29/06, snacktime <> 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.
    snacktime, Oct 30, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben
    Replies:
    0
    Views:
    552
  2. Christian Reiser

    Schema for IPv4: valid or not?

    Christian Reiser, Aug 13, 2004, in forum: XML
    Replies:
    0
    Views:
    522
    Christian Reiser
    Aug 13, 2004
  3. qazmlp

    code for validating IPv4 address

    qazmlp, Jul 27, 2003, in forum: C Programming
    Replies:
    14
    Views:
    991
    Default User
    Jul 29, 2003
  4. tweak
    Replies:
    14
    Views:
    2,763
    Eric Sosman
    Jun 11, 2004
  5. Jesse van den Kieboom

    Ipv6 on a ipv4/ipv6 hostname

    Jesse van den Kieboom, Jun 5, 2005, in forum: Ruby
    Replies:
    1
    Views:
    340
    Dibya Prakash
    Jun 5, 2005
Loading...

Share This Page