r/cpp_questions • • 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.

0 Upvotes

6 comments sorted by

14

u/AKostur 12d ago

Given that recent commits were done by “codex”, please clarify the use of AI/LLMs in this effort.

-13

u/Vousch 12d ago

Por favor, esclareça melhor o que quer dizer com isso, o "codex" teve uma participação irrisória na autoria da biblioteca.

12

u/KingAggressive1498 12d ago

in a previous thread you were asking questions about using AI to migrate from C++26 to C++17 and now you've done probably a month's worth of migration work in like a week. AI has now touched a substantial portion of your code and you need to be willing to talk about that.

-5

u/Vousch 12d ago

A situação saiu do controle e o uso de IA se tornou um vício da minha parte. Eu pretendia criar o LightnerX sozinho, eu fiz isso mas para correção de bugs e falhas eu recorri a agentes a perdi o controle da situação. Vou dar umas pausas no desenvolvimento do LX para tomar o controle da situação arquitetural.

7

u/KingAggressive1498 12d ago

that's very honest but not very technical which is more what u/AKostur was looking for I think.

-3

u/Vousch 12d ago

De fato. Lancei uma nota de desenvolvimento no README do LX.