Skip to content

Instantly share code, notes, and snippets.

@rakaur
Created April 6, 2011 17:29
Show Gist options
  • Save rakaur/906097 to your computer and use it in GitHub Desktop.
Save rakaur/906097 to your computer and use it in GitHub Desktop.
rhuarc:rhubot rakaur$ ruby -v
ruby 1.9.2p180 (2011-02-18 revision 30909) [x86_64-darwin10.6.0]
rhuarc:rhubot rakaur$ ruby -rsocket -e 'p TCPSocket.new("localhost", 22)'
#<TCPSocket:fd 3>
rhuarc:rhubot rakaur$ ruby -rsocket -e 'p TCPSocket.new("localhost", 22, "localhost")'
#<TCPSocket:fd 3>
rhuarc:rhubot rakaur$ ruby -rsocket -e 'p TCPSocket.new("localhost", 22, "127.0.0.1")'
#<TCPSocket:fd 3>
rhuarc:rhubot rakaur$ ruby -rsocket -e 'p TCPSocket.new("localhost", 22, "127.0.0.0")'
-e:1:in `initialize': Can't assign requested address - bind(2) (Errno::EADDRNOTAVAIL)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment