From: Brian Candler Date: 2009-05-19T22:46:07+09:00 Subject: Re: Detect TCPSocket interruptions/disappearance Andrew Edwards wrote: > I have put together a skeleton process to monitor this, shown below. > However I am not sure how to reliably detect when the phone system > goes away, say it is rebooted or similar. Try setting SO_KEEPALIVE on your socket. It's easier if you can send a periodic message to the far side and check you get a response within a second or two. However if you can't do that - i.e. you have to be an entirely passive listener - then SO_KEEPALIVE sends periodic probes at the TCP layer. It may take a few minutes to detect that the connection has gone though. -- Posted via http://www.ruby-forum.com/.