codecat / unet

Unified Lobby Networking library in C++, providing cross-play between Steam lobbies, Gog Galaxy lobbies, and Enet sockets.
MIT License
7 stars 1 forks source link

Optimize reliable packet reassembly #7

Open codecat opened 5 years ago

codecat commented 5 years ago

Due to the fact that we can't really know if a packet was sent reliably or unreliably, we have to use a single bit in the sequence ID to check if it was sent reliably or not.

There's a couple places that have to optimize the packet flow:

Optionally, we can also make some sort of service-specific flag system. This will for example help us bypass all of the issues raised with reliable packet size limits re-assembly by simply returning 0 in ServiceSteam::ReliablePacketLimit.