title: Socket.IO: Detect disconnected sockets
body: <p>I have a <code>socket.io</code> server/client. When a <code>client</code> safely disconnects, on the server side, the line</p>
  
  <pre><code>socket.on('disconnect', function() {
  
  });
  </code></pre>
  
  <p>is called.</p>
  
  <p>However, if the client server crashes, then <code>socket.on('disconnect')</code> is never called; I know this because I recursively print out <code>wss.sockets.connected.length</code> and the number does not decrease.</p>
  
  <p>How can I check that such a crash has happened on the server?</p>