-
Notifications
You must be signed in to change notification settings - Fork 0
Implement cmd/test-client/main.cpp UDP send/receive loop #14
Copy link
Copy link
Open
Labels
cppC++ language files, build scripts, or C++-specific modulesC++ language files, build scripts, or C++-specific modulesserviceMicroservice implementations or service–service integration workMicroservice implementations or service–service integration worktestingGeneric test work (integration tests, system tests, or test framework changes)Generic test work (integration tests, system tests, or test framework changes)
Metadata
Metadata
Assignees
Labels
cppC++ language files, build scripts, or C++-specific modulesC++ language files, build scripts, or C++-specific modulesserviceMicroservice implementations or service–service integration workMicroservice implementations or service–service integration worktestingGeneric test work (integration tests, system tests, or test framework changes)Generic test work (integration tests, system tests, or test framework changes)
• 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:
Build an
InputEvent(with incrementingSequenceNum), serialize.Sleep a random amount up to
jitterms.With probability lossPct, drop (skip send). Otherwise, send UDP to serverAddr.
Concurrently, listen on UDP port
:60000forWorldStatemessages (C++ serialization), decode, andstd::cout <<the tick and positions.Exit cleanly on SIGINT, printing summary stats (packets sent, packets lost, ticks received).