Created
November 11, 2011 20:20
-
-
Save donpdonp/1359122 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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