|
Aegis2D
Modular C++26 2D game engine for networked games
|
Receiver side of the acknowledgements: which datagrams of the peer arrived. More...
#include <aegis2d/net/reliability.hpp>
Public Member Functions | |
| bool | record (std::uint16_t sequence) noexcept |
| Records the sequence of a datagram received from the peer. | |
| std::uint16_t | ack () const noexcept |
The ack field to send. | |
| std::uint32_t | ack_bits () const noexcept |
The ack_bits field to send. | |
| bool | received_any () const noexcept |
| Tells whether any datagram was recorded. | |
Receiver side of the acknowledgements: which datagrams of the peer arrived.
Gives the ack and ack_bits fields of the next datagram sent to the peer: the most recent sequence received, and one bit for each of the 32 before it. Before anything is received, ack is 65535, the sequence before the peer's first one (0), and ack_bits is 0 (RFC section 5.1).
|
inlinenoexcept |
The ack field to send.
|
inlinenoexcept |
The ack_bits field to send.
n set when sequence ack() - 1 - n was received.
|
inlinenoexcept |
Tells whether any datagram was recorded.
false until the first record().
|
noexcept |
Records the sequence of a datagram received from the peer.
Call it only for datagrams whose header and payload are valid: a dropped datagram must not be acknowledged.
| sequence | The datagram's sequence field. |
true for a datagram not seen before; false for a duplicate, or for one older than the 32 sequences before ack (or 32768 away from it), which is not acknowledged.