I am trying to pass an Express’ Response
object from child process A
to child process B
.
In a.js
, I am doing the following process.send(process.pid, res.socket);
In b.js
, I can get the response socket by using the following
process.on('message', (msg, handle) => { var output = { msg: msg, socket: handle }; console.log(output); handle.write('hello there client!'); }
When I print the contents of output
, I do get the msg: 4355
and socket
is connected and contains the IP address and port of the connected client. But when I use the socket to write hello there client!
, the client did not receive the response. Please help?
My client is Postman.