I am building a client-server system where the client sends SQL commands to the server via an EasyTCPSocket, and the server runs the SQL and returns the RecordSet. It is working well.
Given that there may be gaps of a few minutes (or longer) between client conversations with the server:
- should I get the client to Close the EasyTCPSocket after each use?
- If I don’t close the EasyTCPSocket, will it reuse the same EasyTCPSocket on next connection or create a new one, clogging up the server until they timeout?
- If I don’t close the EasyTCPSocket, will the max socket connections be reached quickly if lots of Xojo clients are connecting (assuming the number of clients is less than MaximumSocketsConnected)?
- Is there a problem if I DO close the EasyTCPSocket after each use, other than the delay time to re-connect?
I am erring on the side of closing the EasyTCPSocket so the server load will be minimised and can support more clients. Am I wrong? The clients will never be really ‘chatty’, talking at most once per minute.