Introduction to the structure of the Network Game Program


Overview

This network game program is a client-server based program. A server daemon is started at first and using a port, which is not occupied, in the range of 5000 to 10000. After the server daemon is started, the port it binded to would begin listening for clients connections.

When a client process starts, it would send a TCP connection request to the server daemon. After the connection is established, the client would either start playing the game or keep waiting, depending on the current number of clients already playing the game.

All communications between clients are through the server. It is a star-like topology communication.