Merge pull request #19 from dkillebrew/master
pass socket to handler for socket.disconnect fixes #18
This commit is contained in:
commit
d49f2f4a63
1 changed files with 5 additions and 11 deletions
|
@ -306,21 +306,15 @@ function init(path,config,log,port){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
server.log(socket.id, 'socket disconnected'.notice);
|
server.log('socket disconnected'.notice);
|
||||||
var deadSocket=socket.id;
|
|
||||||
|
|
||||||
if(socket)
|
if(socket)
|
||||||
socket.destroy();
|
socket.destroy();
|
||||||
|
|
||||||
server.sockets.splice(i,1);
|
server.sockets.splice(i,1);
|
||||||
|
|
||||||
server.trigger(
|
server.trigger('socket.disconnected', socket);
|
||||||
'socket.disconnected',
|
|
||||||
{
|
|
||||||
id:deadSocket
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue