title: Socket.IO handling disconnect event
body: <p>Can't handle this disconnect event, don't know why socket is not sent to the client / client doesn't respond!</p>
  <p>Server</p>
  <pre><code>io.sockets.on('connection', function (socket) {
  
    socket.on('NewPlayer', function(data1) {
  
      online = online + 1;
      console.log('Online players : ' + online);
      console.log('New player connected : ' + data1);
      Players[data1] = data1;
      console.log(Players);
  
    });
  
    socket.on('DelPlayer', function(data) {
  
      delete Players[data];
      console.log(Players);
      console.log('Adios' + data);
  
    });
  
    socket.on('disconnect', function () {
  
        socket.emit('disconnected');
        online = online - 1;
  
    });
  
  });
  </code></pre>
  <p>Client</p>
  <pre><code> var socket = io.connect('http://localhost');
  
      socket.on('connect', function () { 
  
          person_name = prompt(&quot;Welcome. Please enter your name&quot;);
  
          socket.emit('NewPlayer', person_name);
  
          socket.on('disconnected', function() {
  
              socket.emit('DelPlayer', person_name);
  
          });
  
      });
  </code></pre>
  <p>As you can see when a client disconnects the Array object[person_name] should be deleted, but it's not.</p>