pass socket to handler for socket.disconnect

socket.id does not exist
This commit is contained in:
Daniel Killebrew 2014-08-26 20:15:53 -07:00
parent 390cb7f78d
commit edb706a344

View file

@ -306,20 +306,14 @@ 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;
}