Skip to content
modkitv0.2

Example 26 - mk_peer/mk_channel echo test (headless, no window).

← All examples26_peer_echo

26_peer_echo server # echoes every message back on its channel 26_peer_echo client [host] # sends N messages on a reliable AND an # unreliable channel, verifies the echoes Verifies the transport-agnostic layer: P1 - message boundaries preserved, varying lengths intact, correct per-peer attribution. P2 - channel 0 (RELIABLE_ORDERED, via KCP) delivers every message in order even under packet loss; channel 1 (UNRELIABLE) may lose messages but never corrupts them. Run the server with MK_NET_LOSS=20 to drop 20% of datagrams and watch the reliable channel still arrive complete while the unreliable one thins out.

Runs the WebAssembly build on this page. Click the canvas to give it keyboard focus.

Number
26
Tags
networking
Requires
MODKIT_ENABLE_NETWORKING
Source
examples/26_peer_echo/main.c

Build and run

./scripts/build-linux.sh release --target=26_peer_echo --run