Welcome to my new Tutorial ! I don't know if you noticed, but there are different types of networks…
First, the UDP one ! (The one that was imposed on us, but don't tell anyone 😶)
Secondly, the TCP one, but we are not going to discuss it here….
A UDP protocol is based on a simple principle: There is no verification of the correct reception of the packet. Given the complexity of the process, we have created a magical tool to automate all of this, the Communicator!
A communicator is made up of two sub-modules allowing closer interaction with the sockets. The Receiver, for receiving packets, and the Sender to sending it. While the communicator will take care of making the connection between the data and the sockets.
In order to facilitate the transport of network information, we have created the Client class. This class contains the IP ("127.0.0.1"), port (0) and client ID (0).
All of the clients concerned by communications are stored within the Communicator. You will be able to find there all the utility functions necessary for the interaction with the list.
In a few words, the receiver consists of a background task retrieving the sockets received at the specified destination. It will then decode the header of the transferred data (CF UDP Protocols page) and ensure that the request is valid. Then it will add the data received to the list of messages to be processed.
Here is attached all the utility functions allowing to interact with the list of messages :