Back to browse
GitHub Repository

Single-header C library for TCP/IPC messaging on Linux

6 starsC

Vibe, a single-header C networking library for Linux

by enduku·May 1, 2026·4 points·0 comments

AI Analysis

●●SolidCozyBig BrainNiche Gem

Refcounted broadcast chunks save memory versus copying payloads for every peer.

Strengths
  • Refcounted payload chunks prevent copying data for every broadcast fan-out recipient.
  • Single-header design simplifies embedding without requiring external build dependencies or submodules.
  • Explicit per-connection backpressure prevents slow clients from starving the server.
Weaknesses
  • Linux-only epoll implementation excludes macOS and Windows users from running this.
  • Zero stars and five commits suggests very early, untested production readiness.
Target Audience

C developers building low-latency servers or messaging systems on Linux

Similar To

libuv · nanomsg · libevent

Post Description

I wrote vibe, a small single-header C library for framed TCP and Unix-domain-socket messaging on Linux:

https://github.com/xtellect/vibe

It uses one background epoll thread. Application code polls an inbox queue for CONNECTED, DATA, and DISCONNECTED events, and sends through per-connection outboxes.

The pieces I wanted:

- TCP or Unix stream sockets - 4-byte length-prefixed messages - non-blocking application-side polling - single-copy fan-out via refcounted payload chunks - explicit per-connection backpressure instead of unbounded queues

For multicast, the payload is copied once into a refcounted chunk, then queued by reference to each recipient. A 1 KB message to 1,000 peers is one payload allocation/copy plus 1,000 queue nodes, not 1,000 payload copies.

It is Linux-only for now: epoll, eventfd, accept4, and Linux abstract Unix sockets. No UDP, TLS, HTTP, or WebSocket layer.

This is not meant to be a full networking framework. I’m posting mainly for your inputs/revies, especially around connection lifetimes, backpressure accounting, edge cases, and the queue design.

Apache 2.0.

Similar Projects