From: Joel VanderWerf Date: 2010-06-04T00:56:30+09:00 Subject: Re: TCPSocket error Robert Klemme wrote: > 2. 0.0.0.0 cannot be used as a valid address to connect to - you get > EADDRNOTAVAIL as shown above. What surprised to me is that you *can* connect to 0.0.0.0. (It's not surprising that the connection actually goes to 127.0.0.1.) Try it on linux: # shell 1 $ ruby -rsocket -ve 'puts TCPServer.open("0.0.0.0", 8888).accept.gets' ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] hello, world $ # shell 2 $ ruby -rsocket -ve 'TCPSocket.open("0.0.0.0", 8888).puts "hello, world"' ruby 1.8.7 (2010-01-10 patchlevel 249) [x86_64-linux] $ Also, this shows it's not just a ruby thing: $ ping 0.0.0.0 PING 0.0.0.0 (127.0.0.1) 56(84) bytes of data. 64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.051 ms 64 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.043 ms 64 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.038 ms