----- Original Message -----
From: ts <decoux / moulon.inra.fr>
To: ruby-talk ML <ruby-talk / ruby-lang.org>
Cc: <ruby-talk / ruby-lang.org>
Sent: Wednesday, September 19, 2001 8:59 AM
Subject: [ruby-talk:21390] Re: How to tell if port is in use...


> >>>>> "H" == Hal E Fulton <hal9000 / hypermetrics.com> writes:
>
> H> As far as I can see, starting up two TCPServers
> H> on the same port on the same machine
> H> doesn't give an exception...
>
>  Can you give an example ?
>
> pigeon% ruby -rsocket -e 'p TCPServer.new("localhost",
3333);TCPServer.new("localhost", 3333)'
> #<TCPServer:0x401b3f50>
> -e:1:in `new': Address already in use - "bind(2)" (Errno::EADDRINUSE)
>         from -e:1
> pigeon%

Maybe it's a Windows issue. Not sure how the networking stuff
differs... I think NT is more Unix-like, but I'm using 98 (and
1.6.3 cygwin).

In that environment, this one-liner does not give me an error.

Hal