My game server currently launches a thread for each connected client, and handles all data exchange through that socket in a server-blocks-until-client-requests fashion. The problem derives from the blocking, since sometimes the client state should be updated upon server demand without a previous request from the client, which is incompatible with a blocking state.
I have done some research and come up to the next possibilities:
1) Open a second connection to the client, which will only be used for sending data to the client so it can update its state.
2) Use of non-blocking sockets.
3) Use of asynchronous server.
What is the most common design to tackle this particular problem?
2 and 3 seen in https://stackoverflow.com/questions/3895461/non-blocking-sockets