I am using NodeJS to start a socket server (using socket.io). When the client connects, I want to open and run a module that does a bunch of things. Despite the fact that I try to try and catch as much as possible when this module throws an error, it obviously removes the entire socket server from it.
Is there a way I can separate the two, so if the connected client script module fails, it will not necessarily result in the removal of the entire server?
I assume that this requires a child process, but the documentation does not mention starting other instances of node.
I would obviously have to kill the process if the client also disconnected.
source
share