Hamid Rasoulian wrote:
> sock.bind($IP1 , $port1)
...
>   server.bind(nil, $port1)

Two sockets can't bind to the same port. This raises the error:

Errno::EADDRINUSE: Address already in use - bind(2)

You aren't seeing the error because it's raised in a thread. There are
three ways around this:

1. set Thread.current.abort_on_exception=true inside the server thread

2. set Thread.abort_on_exception=true gloablly.

3. put a begin-rescue-end clause around the whole thread code (inside
the Thread.start block).

-- 
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407