I’ve implemented a lot of network protocols lately, for work and private projects. I’d like to show you the basic implementation I mostly use and has been proven to be very resource friendly, fast and stable. The Protocol At the beginning there is the protocol definition. For this example I will use a simple single frame/packet based protocol to exchanges data between two endpoints (e.g.: client and server). The Packet // packet.