I’m coding an application where the client app needs to authenticate with a server to log in and the every half hour send a packet and receive some info and then sleep for another half hour.
Would the proper way be to start the socket everytime and close after packet sent and received. Or should i keep them open and connected at all time ?.
There’s gonna be 100+ clients running simultanious, connecting to the server.
Btw the data sent is very important that it is sent and retrieved in MAX 5-10 seconds
Definitely, it’s better to open a new connection each time and close it immediately after. Opening a new connections doesn’t take long and 5-10 secs requirement is more than easy to meet with this approach.