Hi,

It seems to be, that there's either an bug in TCPServer, or
the description in "Programming Ruby" is wrong.

The book says about TCPServer.new, that if a host is omitted, it
will listen on *all* interfaces (equivalent to "0.0.0.0").
But that's not the case.

I tried following code:
  require "socket"
  s = TCPServer.new(8080)
  s.accept

Then 'telnet 192.168.1.1 8080' and got a "Connection refused".
(192.168.1.1 is my local IP-adress)
But 'telnet localhost 8080' works!!!
(where localhost is 127.0.0.1)


When I write:
  ...
  s = TCPServer.new("0.0.0.0", 8080)
  ...

It works as expected, with all interfaces.

Regards

--
Michael Neumann