Server - nixfanboy/WrathNet GitHub Wiki
The Server
In a Server->Client infrastructure, the Server listens for connections from Clients on a specified port and protocol, and optionally a specific network address. The Server binds to an unused port on the protocol specified in the Constructor.
Design
The Server class is a surface class that contains a Manager class that is dependent on the Protocol being used. The Class in charge of protocol and data management would be the ServerManager class, with direct subclasses ServerTcpManager and ServerUdpManager.
Multi-threading
The WrathNet Engine uses three background threads for each Server, one listening for new clients coming in (recvThread), another for executing the code specified in the ServerListener according to the onReceive(), onClientConnect(), and onClientDisconnect() methods overridden by the developer (execThread). This thread is also responsible for detecting compressed data and decompressing it. The final thread is the data receive thread, which is a thread dedicated to receiving and storing data from all of the clients (clientRecvThread).