fixed server delete soicket method

This commit is contained in:
Brandon Miller 2014-03-01 02:30:26 -08:00
parent a3402290cd
commit 7484a520ea
2 changed files with 19 additions and 7 deletions

View File

@ -290,14 +290,21 @@ function init(path,config,log,port){
for(var i=0, count=server.sockets.length; i<count; i++){
var socket=server.sockets[i];
if(socket.readable)
continue;
console.log(count);
if(socket){
if(socket.readable)
continue;
}
server.log('Socket disconnected'.notice);
socket.destroy();
if(socket)
socket.destroy();
delete server.sockets[i];
server.sockets.splice(i,1);
console.log('deleted'.error);
server.trigger(
'socket.disconnected'

View File

@ -1,7 +1,7 @@
{
"name": "node-ipc",
"version": "0.9.0",
"description": "A nodejs module for local and remote Inter Process Communication (IPC) uses Unix Sockets for local communication avoiding the network card for lower overhead and latency. ## Solid but, ### Still under development and lacking documentation, but useable.",
"version": "0.9.7",
"description": "A nodejs module for local and remote Inter Process Communication (IPC), Neural Networking, and able to facilitate machine learning.",
"main": "node-ipc.js",
"directories": {
"example": "example"
@ -16,10 +16,15 @@
},
"keywords": [
"IPC",
"Neural Networking",
"Machine Learning",
"inter",
"process",
"communication",
"unix",
"TCP",
"UDP",
"domain",
"sockets",
"threaded",
"communication",
@ -37,5 +42,5 @@
"bugs": {
"url": "https://github.com/RIAEvangelist/node-ipc/issues"
},
"homepage": "https://github.com/RIAEvangelist/node-ipc"
"homepage": "riaevangelist.github.io/node-ipc/"
}