r/cpp_questions • u/Vousch • 12d ago
OPEN Looking for C++17 API design feedback on my networking library
I've been developing LightnerX, a C++ networking library built on top of GameNetworkingSockets.
I recently migrated it from C++26 modules to C++17, which required reorganizing the public API into traditional headers and source files.
The library provides client-server networking, connection management, message batching, and an interpreter for a small semantic communication protocol called INER.
I'm trying to improve the API before adding more features, particularly in three areas:
Resource ownership: Client and Server manage their networking lifecycle, while applications control initialization, updates, and how components interact.
Error handling: Operations return lightnerx::Result, allowing callers to inspect failures without relying on exceptions for ordinary networking errors.
Modularity: Networking, connection management, and message interpretation are separate components.
I'm interested in whether these design decisions make sense from a C++17 perspective.
Are there any API patterns or ownership pitfalls I should reconsider? Would you approach error handling or component separation differently?
I'm not looking for a general project showcase. I'm mainly interested in feedback on the public interfaces and design.
Relevant headers: https://github.com/pietroth/LightnerX/tree/main/include/lightnerx
Any technical criticism is appreciated.
14
u/AKostur 12d ago
Given that recent commits were done by “codex”, please clarify the use of AI/LLMs in this effort.