vkmEngine 1.0.15
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::NetInbox Class Reference

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.

Detailed Description

The receiving half: each message handed on once, in the order it was sent.

Member Function Documentation

◆ read()

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.

Parameters
inThe packet, at its messages.
deliverCalled for each new message, in order.
Returns
False when the messages did not decode.

The documentation for this class was generated from the following file: