Design

Our solution consists of two servers, one main server, a Heartbeat server, and a client. The TCP protocol is used to communicate between the server and clients. Both the server and the client are implemented with threads. Main server is responsible for all communication between clients such as chat and chess-moves. The Heartbeat server ensures that an already established connection with a particular client is still valid, ie that the client exists and responds back. Main server listens on port 45000 and Hearbeat server listens on port 45001

Both the Main and the Heartbeat-servers use a monitor to synchronize the communication. The server and the client uses a well-defined communication protocol, which is found in both the server and the client.