Socket
Socket
Sign inDemoInstall

pm2-axon

Package Overview
Dependencies
6
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.4 to 2.0.5

72

lib/sockets/sock.js

@@ -373,46 +373,40 @@

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
try {
fs.unlink(port);
} catch(e) {
}
self.server.listen(port, host, fn);
//}
});
if (unixSocket) {
// TODO: move out
this.server.on('error', function(e) {
debug('Got error while trying to bind', e.stack || 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) {
debug('Got sub-error', e2);
if (e2.code == 'ECONNREFUSED') {
// No other server listening, so we can delete stale
// socket file and reopen server socket
try {
fs.unlink(port);
self.server.listen(port, host, fn);
} catch(e) {
console.error(e.stack || 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.connect({path: port}, function() {
// Connection is possible, so other server is listening
// on this file socket
console.error('Process is already listening on socket %s', port);
process.exit(0);
});
}
});
}
// 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.4",
"version": "2.0.5",
"author": "TJ Holowaychuk <tj@vision-media.ca>",

@@ -6,0 +6,0 @@ "author": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc