I have 2 servers running 24/7 in a single process (file server.js):
net module)ExpressJS HTTP ServerMy TCP Socket Server receives messages from multiple gps trackers and inserts them on the DB (MySQL). It does that by instantiating a worker (a child process created by .fork() --> file worker.js) whenever it receives a socket connection; the worker will then take care of every following message coming by that socket.
My HTTP Server receives HTTP/AJAX requests from browser clients and answers them. Some of these requests require that my http server send the request to a worker so it can handle it better. The worker will then, later on, send back some information to the server.
Now, here it lies my problem. How can I send the response to the initial request from the browser? Should I just pass around the (req,res) objects from Express and when it comes back to the server, with the worker's information, I send whatever I want to the browser?