When calling emit right before disconnect the emit will not be sent to the server making it unpredictable behaviour.
E.g. following code:
import ipc from "node-ipc";
ipc.config.id = "foo";
ipc.serve(() => {
ipc.config.id = "bar";
ipc.connectTo("foo", () => {
ipc.of["foo"].emit("test", "test");
ipc.disconnect("foo");
})
})
ipc.server.on("test", console.log);
ipc.server.start();
will never log. In the debug output it shows
- (server) Starting server as Unix || Windows Socket
- (client) requested connection to foo
- (client) connecting to foo
- (client) dispatch event
- (client) close connection
- (server) socket disconnected
This behaviour is required because I want one of the possible execution paths to send a single message to the server and then close the application (other paths would use the socket as a long time connection)
When calling emit right before disconnect the emit will not be sent to the server making it unpredictable behaviour.
E.g. following code:
will never log. In the debug output it shows
This behaviour is required because I want one of the possible execution paths to send a single message to the server and then close the application (other paths would use the socket as a long time connection)