HNNewShowAskJobs
Built with Tanstack Start
SwiftNet – C networking library (macOS-only for now, needs Linux testers)(github.com)
2 points by deadlightreal 4 hours ago | 1 comment
  • deadlightreal4 hours ago

    Hello dear people,

    I’m working on SwiftNet, a small and easy-to-use C library for making networking communications in C straightforward. It’s a wrapper over Berkeley sockets with a simple API, readable, and easy to integrate.

    Right now, it’s only been tested on macOS, so I’m looking for contributors to:

    Test it on Linux Suggest improvements Help refine the design/API The codebase is pretty small, and while the API is straightforward, the internals are admittedly a bit rough right now. I’m still learning and improving!

    Why I built this:

    I wanted to create a C library that makes sending data over the network reliable and easy, while learning more about low-level networking and systems design. Everything is written in pure C, built with a basic CMake setup, and has no external dependencies.

    Example usage:

    // Server sends "hello" to every client that sends a message void server_message_handler(uint8_t* data, SwiftNetPacketServerMetadata* metadata) { swiftnet_server_append_to_packet(server, "hello", strlen("hello")); swiftnet_server_send_packet(server, metadata->sender); swiftnet_server_clear_send_buffer(server); }

    How you can help: Test on Linux: clone, build with cmake, and run the tests in /tests Suggest improvements to the overall library or code clarity Share ideas for future features

    Thanks for checking it out! Ask me anything.

    Repo: https://github.com/deadlightreal/SwiftNet