added QUIC

This commit is contained in:
Jorijn van der Graaf 2026-05-06 04:06:17 +02:00
commit 45479a46ff
22 changed files with 1448 additions and 66 deletions

View file

@ -4,12 +4,13 @@ A cross-platform C++ networking library providing TCP and HTTP client/server fun
## Overview
Crafter.Network is a comprehensive networking library designed for modern C++ applications. It provides both TCP and HTTP networking capabilities with support for synchronous and asynchronous operations, making it suitable for a wide range of networking tasks.
Crafter.Network is a comprehensive networking library designed for modern C++ applications. It provides TCP, HTTP, and QUIC networking capabilities with support for synchronous and asynchronous operations, making it suitable for a wide range of networking tasks including real-time multiplayer games.
## Features
- **TCP Networking**: Client and server implementations for TCP connections
- **HTTP Support**: Full HTTP client and server implementations with routing capabilities
- **QUIC Networking**: Encrypted, multi-stream transport via msquic — reliable streams for control plane, unreliable datagrams for low-latency state sync
- **Asynchronous Operations**: Thread pool-based async operations for improved performance
- **Cross-Platform**: Built for Unix-like systems with socket-based networking
- **Modern C++**: Uses C++ modules, STL containers, and modern C++ features
@ -21,10 +22,12 @@ The library follows a modular design using C++20 modules:
### Core Modules
- `Crafter.Network`: Main module that exports all components
- `Crafter.Network:ClientTCP`: TCP client implementation
- `Crafter.Network:ListenerTCP`: TCP server implementation
- `Crafter.Network:ListenerTCP`: TCP server implementation
- `Crafter.Network:ClientHTTP`: HTTP client implementation
- `Crafter.Network:ListenerHTTP`: HTTP server implementation
- `Crafter.Network:HTTP`: HTTP protocol utilities and data structures
- `Crafter.Network:ClientQUIC`: QUIC connection (client + accepted-server side) with reliable streams and unreliable datagrams
- `Crafter.Network:ListenerQUIC`: QUIC listener accepting incoming connections
## Components
@ -96,6 +99,8 @@ The library includes comprehensive tests covering:
## Dependencies
- Crafter.Thread: Thread pool management for asynchronous operations
- **msquic** — fetched and built automatically as a Crafter `ExternalDependency` (no system install required). The build clones `microsoft/msquic` recursively into the per-project external cache, configures it via CMake (`QUIC_TLS_LIB=quictls`, tests/tools/perf disabled), and links the produced `libmsquic` into the QUIC modules.
- On Linux msquic links against `libnuma` (provided by the `numactl` package on most distros).
## Usage Example