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;
}
fs.unlink(
this.path,
startServer.bind(this)
);
if(this.config.unlink){}
fs.unlink(
this.path,
startServer.bind(this)
);
}else{
startServer.bind(this)();
}
}
}

View File

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