title: Detecting disconnected client side socket connection (cross-platform applicability)
body: <p>I know there are hundreds of answers for this question, but I cannot get it done with respect to my situation. The scenario is like this, we have a server written in TCP/IP protocol, we have multiple clients connected to this server. The client here is a software module which before starting on a client machine, registers its presence in the server and loads the functionalities. But the problem is that this software module getting crashed and there by no <code>socket.close()</code> is called, this will make its footprints still present in the server even though its crashed. How to recognize this?</p>
  
  <p>I am using <code>select()</code> method in the client to notify any info from client and server (vice-versa)
   I cannot create a process separately for each client request in the server, neither can I create a parent-child mechanism in the client machine.
   <code>tcp-keepalive</code> is not applicable as we need to tweak the registry in Windows? I need a x-platform compatible solution.
  I have read that <code>recv()</code> to the connected socket in the server code will return some values from 'that' client such as <code>0</code> for socket closed? Can I use this to clear off the client socket registration in the server database? Will this work?</p>