Skip to content

Implement cmd/test-client/main.cpp UDP send/receive loop #14

@justintulloch

Description

@justintulloch

• Parse flags:
--serverAddr (e.g. localhost:20000)
--clientID (e.g. client-1)
--jitter (int, max ms)
--lossPct (double, 0.0–1.0)
• Every 50 ms:

  1. Build an InputEvent (with incrementing SequenceNum), serialize.

  2. Sleep a random amount up to jitter ms.

  3. With probability lossPct, drop (skip send). Otherwise, send UDP to serverAddr.

    • Concurrently, listen on UDP port :60000 for WorldState messages (C++ serialization), decode, and std::cout << the tick and positions.

    • Exit cleanly on SIGINT, printing summary stats (packets sent, packets lost, ticks received).

Metadata

Metadata

Assignees

No one assigned

    Labels

    cppC++ language files, build scripts, or C++-specific modulesserviceMicroservice implementations or service–service integration worktestingGeneric test work (integration tests, system tests, or test framework changes)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions