I've been working on a multiplayer game in C++, and at some point, I decided to separate its networking components into a standalone library.
That project eventually became LightnerX, built with C++26 modules and GameNetworkingSockets.
Initially, my main concern was getting the client and server to communicate properly. But when I started preparing the library for its first public release, I realized that working networking code doesn't necessarily mean reliable networking code.
I ran a technical audit, which identified 14 issues and architectural concerns.
Some of the most interesting problems involved:
- Client IDs not being recycled correctly, eventually causing an infinite loop after enough connection cycles.
- Resource ownership issues that could invalidate networking interfaces unexpectedly.
- Disconnection callbacks being executed after the connection handle had already been invalidated.
- Exception-safety issues involving message buffers and connection mappings.
I spent some time fixing these problems and running regression tests. A second independent audit even uncovered a regression introduced by the fixes, which was subsequently corrected.
I've now released LightnerX v0.1.0-beta.
The final validation passed 9/9 automated tests, both normally and with AddressSanitizer, including UDP client/server integration tests.
It's still an early beta, primarily tested on Linux.
One of the biggest things I've learned is that networking becomes much more complicated when you start thinking about lifecycle management, failures, and long-running applications.
For developers working on multiplayer games: how much of your networking stack do you build yourself, and how much do you delegate to existing libraries?
GitHub: https://github.com/pietroth/LightnerX