https://github.com/dankmeme01/qunet-cpp
https://github.com/dankmeme01/qunet-cpp
Last synced: 23 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/dankmeme01/qunet-cpp
- Owner: dankmeme01
- License: mit
- Created: 2025-06-19T19:12:40.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2026-05-16T23:56:51.000Z (about 1 month ago)
- Last Synced: 2026-05-27T10:38:30.339Z (23 days ago)
- Language: C++
- Size: 720 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Qunet
Advanced asynchronous C++ networking library, powered by [Arc](https://github.com/dankmeme01/arc) and used by [Globed](https://github.com/GlobedGD/globed2).
This library is available in Rust: [dankmeme01/qunet](https://github.com/dankmeme01/qunet)
## Features
* Support for four underlying transports: TCP, QUIC, Reliable UDP and WebSockets
* UDP transport allows for choosing reliability per-message, perfect for games and other low latency cases
* Handles UDP fragmentation at protocol level
* Full support of IPv4 and IPv6
* Tiny data overhead: one handshake and then just 1 byte per data message (if no extra headers are present)
* ZSTD and LZ4 compression of messages, applied per-message
* Extensive DNS lookups, including SRV queries
* Smart logic for connection & reconnection, including [happy eyeballs](https://datatracker.ietf.org/doc/html/rfc6555)
* Statistics tracking (bytes/messages sent, compression ratios, etc.)
* Highly confgiruable, including being able to disable some features at compile time, e.g. QUIC or advanced DNS resolver.
Currently, this library does not include server functionality. For making a Qunet server that you can connect to, use the [Rust library](https://github.com/dankmeme01/qunet)
## Usage
This section is incomplete as there's a ton to describe here :)
See [tester/main.cpp](./tester/main.cpp) for some example usage. Qunet is an Arc-based async library, and thus an Arc runtime is needed to create a connection. Other calls like `sendData()` are not required to be in the context of a runtime, only those that return a `Future` are.
## Roadmap
* WebSockets transport
* Implement micro-batching of messages - with stream-based transports this is relatively simple, with UDP-based transports this requires a protocol update. We have 3 bits in the header byte that are unused, and we can use one of them to signify inclusion of a "Multi Message" extension which can carry some data such as offset and length of each individual message.
* ???