Skip to content

Instantly share code, notes, and snippets.

@donpdonp
Created November 11, 2011 20: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 donpdonp/1359122 to your computer and use it in GitHub Desktop.
Save donpdonp/1359122 to your computer and use it in GitHub Desktop.
server.on('connection', function(socket) {
var client_id = clients.push(socket)
console.log('connected. '+clients.length+' clients. '+clients);
socket.on('data', go)
socket.on('close', function() {
clients.splice(client_id-1,1)
console.log('closed. client list '+clients)
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment