Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
sequence.hpp File Reference

Comparison of 16-bit sequence numbers across their wrap from 65535 to 0. More...

#include <cstdint>

Go to the source code of this file.

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::net
 Binary serialization, UDP/TCP sockets and the network thread.
 

Functions

constexpr bool aegis2d::net::sequence_greater_than (std::uint16_t a, std::uint16_t b) noexcept
 Whether sequence a was sent after sequence b, the counter having possibly wrapped in between.
 
constexpr bool aegis2d::net::sequence_less_than (std::uint16_t a, std::uint16_t b) noexcept
 Whether sequence a was sent before sequence b, the counter having possibly wrapped in between.
 

Variables

constexpr std::uint16_t aegis2d::net::sequence_half_range = 32768
 Half the range of a 16-bit sequence: the largest gap at which two sequences are still ordered is one less.
 

Detailed Description

Comparison of 16-bit sequence numbers across their wrap from 65535 to 0.

Serial number arithmetic of RFC 1982, as required by section 2.2 of the protocol RFC (docs/rfc/udp-header.md). Header-only.