http://www.perlmonks.org?node_id=73772


in reply to How can I make a client realize the server connection is gone?

If the server closes the connection you should recieve an EOF on the socket. HOWEVER, tcp is designed to run over very slow and lossy networks, it is hard to tell the difference between a very slow/lossy network and a dead server.. In fact in tcp terms it is impossible. TCP works on a series of timeouts EVENTUALLY it will work out that the server is dead but it will take a long time.
Having said all that things to consider.

For more information on this topic have a look at the UNIX Socket FAQ This document is as relivent to perl as it is to C, dont be put off by the fact that the examples are all in C. TCP is TCP is TCP.
  • Comment on Re: How can I make a client realize the server connection is gone?