Skip to content

ludus::network::LinkSimulator

Ludus Wiki · API overview · Browse API

Class

One direction, explicitly advanced by caller time (microseconds).
All valid Send/Receive calls, including Full/Empty results, advance the monotonic clock. Reset validates before clearing; bad configuration preserves the old link. Full/overflow leaves packet storage and RNG unchanged. Send copies opaque bytes (also supports malformed-message fixtures); Receive publishes owned bytes. Duplication admission is atomic: both copies must fit. No sleep/OS/thread/heap.

Declared in modules/network/core/include/ludus/network/core/link_simulator.h

#include <ludus/network/core/link_simulator.h>
class ludus::network::LinkSimulator final

Methods

Reset

LinkStatus ludus::network::LinkSimulator::Reset(const LinkConfig &config) noexcept

Related types: LinkStatus · LinkConfig

Declared in modules/network/core/include/ludus/network/core/link_simulator.h

Send

LinkStatus ludus::network::LinkSimulator::Send(uint64 nowUs, std::span< const uint8 > message) noexcept

Related types: uint64 · uint8 · LinkStatus

Declared in modules/network/core/include/ludus/network/core/link_simulator.h

Receive

LinkStatus ludus::network::LinkSimulator::Receive(uint64 nowUs, OwnedMessage &message) noexcept

Related types: uint64 · LinkStatus · OwnedMessage

Declared in modules/network/core/include/ludus/network/core/link_simulator.h

GetPendingCount

usize ludus::network::LinkSimulator::GetPendingCount() const noexcept

Related types: usize

Declared in modules/network/core/include/ludus/network/core/link_simulator.h

GetCounters

const LinkCounters & ludus::network::LinkSimulator::GetCounters() const noexcept

Related types: LinkCounters

Declared in modules/network/core/include/ludus/network/core/link_simulator.h