I'm not sure what you by that. I understand HTTP requests use sockets but my point was that I no longer utilize a constant connection with the clients but instead the clients make calls to URLs in a predefined interval to indicate their status. In my previous setup the clients had to :REST = HTTP = sockets.
It would seem the difference between the working and non-working systems isn't sockets, but the protocol used on top of sockets.
- Connect to the main server .
- Get a free port from the main server.
- Disconnect from the main server and connect to the worker they just received.
- Send their credentials and login.
- Send their status to the worker.
Server side also :
- Main server accepts connections on 2 ports, one for the workers and one for the clients.
- Main server has to keep track of the connected clients on each worker to make sure we don't overload them.
- Workers have to exchange data with the main server regarding the client status.
- I have to combine all of that data and send results back to the clients.
And much much more that overcomplicate things while with the restfull system I just make a simple url call with an API key attached to it. The downside to this is only that k don't have "live" data which means that I have a window of 2 minutes of "wrong data. Yes I understand I could'v gone to REST directly instead if creating the main server/worker solution and I WISH I knew back then... Also I understand I could use the current server and just close the connections instead of maintain them, but I see no point to it.
So to summarize , unless accuracy to second is needed ( like a chat application ? ) I would propably go for a REST solution next time. Hopefully that post saves time for someone else.
Also regarding my initial post, if LC was not crashing after some point, I wouldn't have created the main server/worker solution.