Comparing version 2.0.2 to 2.0.3
@@ -373,33 +373,43 @@ | ||
if (unixSocket) { | ||
// TODO: move out | ||
this.server.on('error', function(e) { | ||
if (e.code == 'EADDRINUSE') { | ||
// Unix file socket and error EADDRINUSE is the case if | ||
// the file socket exists. We check if other processes | ||
// listen on file socket, otherwise it is a stale socket | ||
// that we could reopen | ||
// We try to connect to socket via plain network socket | ||
var clientSocket = new net.Socket(); | ||
this.server.on('error', function(e) { | ||
//if (e.code == 'ECONNREFUSED') { | ||
// No other server listening, so we can delete stale | ||
// socket file and reopen server socket | ||
fs.unlink(port); | ||
self.server.listen(port, host, fn); | ||
//} | ||
}); | ||
clientSocket.on('error', function(e2) { | ||
if (e2.code == 'ECONNREFUSED') { | ||
// No other server listening, so we can delete stale | ||
// socket file and reopen server socket | ||
fs.unlink(port); | ||
self.server.listen(port, host, fn); | ||
} | ||
}); | ||
clientSocket.connect({path: port}, function() { | ||
// Connection is possible, so other server is listening | ||
// on this file socket | ||
throw e; | ||
}); | ||
} | ||
}); | ||
} | ||
// if (unixSocket) { | ||
// // TODO: move out | ||
// this.server.on('error', function(e) { | ||
// if (e.code == 'EADDRINUSE') { | ||
// // Unix file socket and error EADDRINUSE is the case if | ||
// // the file socket exists. We check if other processes | ||
// // listen on file socket, otherwise it is a stale socket | ||
// // that we could reopen | ||
// // We try to connect to socket via plain network socket | ||
// var clientSocket = new net.Socket(); | ||
// clientSocket.on('error', function(e2) { | ||
// if (e2.code == 'ECONNREFUSED') { | ||
// // No other server listening, so we can delete stale | ||
// // socket file and reopen server socket | ||
// fs.unlink(port); | ||
// self.server.listen(port, host, fn); | ||
// } | ||
// }); | ||
// clientSocket.connect({path: port}, function() { | ||
// // Connection is possible, so other server is listening | ||
// // on this file socket | ||
// throw e; | ||
// }); | ||
// } | ||
// }); | ||
// } | ||
this.server.listen(port, host, fn); | ||
return this; | ||
}; |
{ | ||
"name": "pm2-axon", | ||
"description": "High-level messaging & socket patterns implemented in pure js", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"author": "TJ Holowaychuk <tj@vision-media.ca>", | ||
@@ -6,0 +6,0 @@ "author": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38847
1027