How to handle 'half-open' connections- managing client-side socket crash <p>We have a code of Client-Server written in 'C' underlying TCP protocol. The regular socket operations are being performed on both Client and Server. And <code>select()</code> function is being used to monitor multiple connections 'read/ write' mechanisms. The connection has been successfully <code>ESTABLISHED</code>. And using the same <code>select()</code> the connected client sends a message to server for releasing the connection. Up-to this we are happy.</p> <p>The main problem comes when the Client has some issues and has crashed/ stuck-up/ hanged in the middle or because of some other reasons mentioned in here: <a href="http://blog.stephencleary.com/2009/05/detection-of-half-open-dropped.html" rel="nofollow">Detection of Half-Open (Dropped) Connections</a>. The author mentioned about the 'four-way' handshaking! But how can we know the status of the client that has crashed until it sends some signal to Server? Is there a way to know about whether my client is still running (alive) or has some problems (dead) such that the Server closes that particular socket connection that was established? Please let us know. Thank you all... :)</p>