We have started to design a Java server/client program, there will be 1 server with potentially 100 clients, and the clients might be in another country connecting to server through VPN, so network bandwidth might not be ideal. Typical usage is, server to dispatch jobs to clients and clients return results back to server, there won't be too much data need to be transferred between server and client though, maybe around 10s KB per job, and each job needs about 5-10 minutes to run on client.
There are two options we have for the design:
1, Client start the request for socket connection when it is trying register on server, then we keep all the socket connections for communication.
2, Client start the socket connection for registration then close the connection. Server maintain the list of clients, server will start a connection when dispatching job and then close. Client will start a connection again to report results and then close.
The question is, which option will be a better design, in terms of performance and code complexity.