![]() |
vkmEngine 1.0.15
A C++ game engine · vkmengine.com
|
The receiving half: each message handed on once, in the order it was sent. More...
#include <messages.h>
Public Member Functions | |
| bool | read (BitReader &in, const Deliver &deliver) |
| Read a packet's messages, handing on those not seen before. | |
| uint16_t | newest () const |
| The latest sequence handed on, for the acknowledgement; zero before any. | |
| uint16_t | acknowledge () |
| newest(), as an acknowledgement sent: the sender may now be handed on as many again. | |
The receiving half: each message handed on once, in the order it was sent.
| bool Vkm::Engine::NetInbox::read | ( | BitReader & | in, |
| const Deliver & | deliver ) |
Read a packet's messages, handing on those not seen before.
A copy of one already handed on is skipped; one past a gap is not handed on, and is said again by the sender, which only ever starts from what is unacknowledged. At most NET_MESSAGE_WINDOW are handed on between two acknowledgements, as many as an honest sender can have waiting: one past them is left for the sender to say again, so a peer sending packet after packet of messages costs the game no more than one keeping up.
| in | The packet, at its messages. |
| deliver | Called for each new message, in order. |