Merge pull request #19 from dkillebrew/master

pass socket to handler for socket.disconnect fixes #18
This commit is contained in:
Brandon Nozaki Miller 2014-08-27 18:54:35 -07:00
commit d49f2f4a63

View file

@ -306,21 +306,15 @@ function init(path,config,log,port){
continue;
}
server.log(socket.id, 'socket disconnected'.notice);
var deadSocket=socket.id;
server.log('socket disconnected'.notice);
if(socket)
socket.destroy();
server.sockets.splice(i,1);
server.trigger(
'socket.disconnected',
{
id:deadSocket
}
);
server.trigger('socket.disconnected', socket);
return;
}
}