Per-connection outbound message queue.
More...
#include <OutboundQueue.hpp>
|
| void | enqueue (uint8_t replaceKey, std::vector< uint8_t > &&framedBytes) |
| | Enqueue a framed message.
|
| bool | flushTo (NET_StreamSocket *socket, Uint32 maxAgeMs) |
| | Drain the queue, writing each entry to socket.
|
| size_t | depth () const noexcept |
| | Number of entries currently queued (for telemetry / tests).
|
| size_t | totalBytes () const noexcept |
| | Total bytes across all queued entries (for telemetry).
|
| void | clear () noexcept |
| | Drop all queued entries (used on disconnect).
|
Per-connection outbound message queue.
Not thread-safe; each Connection owns one. The Server's broadcast helpers mutate it on the game thread; in stage 3b a dedicated network thread will drain it. For stage 3a everything runs on the game thread.
◆ clear()
| void OutboundQueue::clear |
( |
| ) |
|
|
inlinenoexcept |
Drop all queued entries (used on disconnect).
◆ depth()
| size_t OutboundQueue::depth |
( |
| ) |
const |
|
inlinenodiscardnoexcept |
Number of entries currently queued (for telemetry / tests).
◆ enqueue()
| void OutboundQueue::enqueue |
( |
uint8_t | replaceKey, |
|
|
std::vector< uint8_t > && | framedBytes ) |
Enqueue a framed message.
- Parameters
-
◆ flushTo()
| bool OutboundQueue::flushTo |
( |
NET_StreamSocket * | socket, |
|
|
Uint32 | maxAgeMs ) |
Drain the queue, writing each entry to socket.
Entries older than maxAgeMs are dropped if their replaceKey is non-zero (i.e. unreliable-style snapshot/state). Reliable entries with replaceKey == 0 are always shipped regardless of age.
- Parameters
-
| socket | SDL3_net stream socket to write to. |
| maxAgeMs | Drop unreliable entries older than this (0 = no culling). Plan default: 300 ms. |
- Returns
- False on socket error (caller should disconnect the client).
◆ totalBytes()
| size_t OutboundQueue::totalBytes |
( |
| ) |
const |
|
nodiscardnoexcept |
Total bytes across all queued entries (for telemetry).
◆ entries_
The documentation for this class was generated from the following files: