Skip to content

Instantly share code, notes, and snippets.

@zirosas
Created September 12, 2014 00:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zirosas/71413536e59b18c67725 to your computer and use it in GitHub Desktop.
Save zirosas/71413536e59b18c67725 to your computer and use it in GitHub Desktop.
var allClients = [];
io.sockets.on('connection', function(socket) {
allClients.push(socket);
socket.on('disconnect', function() {
console.log('Got disconnect!');
var i = allClients.indexOf(socket);
delete allClients[i];
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment