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:
We can get an early receive of unreliable messages before callbacks are ran in Context::ReadMessage (also avoiding allocation of NetworkMessage objects there), and just return the message. The only problem is that we can't possibly know if a message is reliable or not in Context::IsMessageAvailable, so maybe this point can't realistically be done?
We can avoid allocating NetworkMessage objects on the heap in Context::ReadMessage if we just return the object by value instead of reference.
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.
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:
Context::ReadMessage
(also avoiding allocation ofNetworkMessage
objects there), and just return the message. The only problem is that we can't possibly know if a message is reliable or not inContext::IsMessageAvailable
, so maybe this point can't realistically be done?NetworkMessage
objects on the heap inContext::ReadMessage
if we just return the object by value instead of reference.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
.