Cluster module support

Added an option to control whether or not node-ipc unlinks the Unix
socket path when it starts a server which, when set to false, allows the
overall application to handle this and allows node-ipc to work with the
Node.js cluster module.
This commit is contained in:
Luke Stratman 2017-05-24 13:36:40 -04:00
parent 22c5688737
commit 1df857ce3a
2 changed files with 9 additions and 4 deletions

View file

@ -58,10 +58,14 @@ class Server extends Events{
return; return;
} }
if(this.config.unlink){}
fs.unlink( fs.unlink(
this.path, this.path,
startServer.bind(this) startServer.bind(this)
); );
}else{
startServer.bind(this)();
}
} }
} }

View file

@ -28,6 +28,7 @@ class Defaults{
this.encoding='utf8'; this.encoding='utf8';
this.rawBuffer=false; this.rawBuffer=false;
this.sync=false; this.sync=false;
this.unlink=true;
this.delimiter='\f'; this.delimiter='\f';