Refactored concurrency in ServerConnection.