From: Brian Candler Date: 2009-05-20T22:04:20+09:00 Subject: Re: Detect TCPSocket interruptions/disappearance Roger Pack wrote: >> In such a case the code simply hangs on the gets request within the >> loop and never returns. > > Odd. If the socket closes then gets should return nil Only if the far-end closes the socket normally. If the machine is just powered off or hard-resets, obviously no packet will be sent. And when it comes back up, it won't know that it used to have an open connection. If you send data *to* it, it will respond with a RST. But this won't happen if you're just passively listening. -- Posted via http://www.ruby-forum.com/.