title: How to avoid CLOSE_WAIT in TCP/ip socket
body: <p>By using select function handling multiple client connection in RPI using c. If CLOSE_WAIT came code is not working.if it occurs I am trying to kill the socket but code is hanging. Without restart how to resolve this 
  Please help in this.....</p>
  
  <p>When CLOSE_WAIT will come how to avoid this.</p>
  
  <p>I am thinking it will come if we didn't close the socket but how to close during network loss. Or else How to do read timeout on server side </p>