Sending and Receiving Data
In the previous chapter, we saw how we can establish a connection between two computers using the high-level Godot Engine ENetMultiplayerPeer
API. But what do we do after that? Why do we establish connections between computers? The foundation of a network is the communication between the connected computers, allowing them to send and receive data. This data is transferred by breaking down the content into small chunks called packets.
Each packet is like a postcard containing the necessary information, such as the sender’s and receiver’s IP addresses, the communication port, and the message’s content. We then send these packets over the network, where they can be routed to their intended recipient. Using communication protocols, such as the UDP protocol, we break the data into packets at the sending end and reassemble them at the receiving end of the relationship.
In this chapter, we will discuss the fundamentals of how packets are...