Faster.Transport
0.0.7
See the version list below for details.
dotnet add package Faster.Transport --version 0.0.7
NuGet\Install-Package Faster.Transport -Version 0.0.7
<PackageReference Include="Faster.Transport" Version="0.0.7" />
<PackageVersion Include="Faster.Transport" Version="0.0.7" />
<PackageReference Include="Faster.Transport" />
paket add Faster.Transport --version 0.0.7
#r "nuget: Faster.Transport, 0.0.7"
#:package Faster.Transport@0.0.7
#addin nuget:?package=Faster.Transport&version=0.0.7
#tool nuget:?package=Faster.Transport&version=0.0.7
โก Faster.Transport
Ultra-low-latency, high-throughput transport layer for real-time distributed systems
Faster.Transport is a modern, zero-allocation, high-performance networking library designed for real-time data transport.
It provides an event-driven TCP Reactor (server) and multiple specialized Particles (clients) for different concurrency and throughput models โ optimized for trading engines, telemetry, simulation, and multiplayer networking.
๐ Core Components
| Component | Description | Protocol | Ideal Use Case |
|---|---|---|---|
| ๐ง Reactor | High-performance async TCP server using SocketAsyncEventArgs and zero-copy I/O. Manages multiple clients efficiently. |
TCP | Low-latency message hubs, servers, brokers |
| โ๏ธ Particle | Single-threaded async client with await-based send/receive. |
TCP | Reliable request/response, command streaming |
| ๐ ParticleFlux | Multi-threaded concurrent client (safe for many producers). Uses lock-free buffer pools. | TCP | Parallel telemetry uploads, multi-threaded simulations |
| โก ParticleBurst | Fire-and-forget ultra-fast client. Trades reliability for raw throughput. | TCP | Tick feeds, sensor data, broadcast updates |
๐งฉ Architecture Overview
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Reactor (Server) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโ โ
โ Accepts clients as โ
โ Connection objects โ
โ Handles framed messages โ
โโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโ
โ
โโโโโโโโโโดโโโโโโโโโ
โ โ
โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โ Particle โ โ ParticleFlux โ
โ (Async) โ โ (Concurrent) โ
โโโโโโโโโโโโโโ โโโโโโโโโโโโโโ
โ โ
โโโโโโโโโโโฌโโโโโโโโ
โ
โโโโโโโโโโโโโโ
โ ParticleBurst โ
โ (Fire & Forget) โ
โโโโโโโโโโโโโโ
Each Particle connects to a Reactor and communicates using a lightweight framed protocol:
[length:int32][payload:byte[]]
This enables efficient, zero-copy parsing of variable-length messages.
๐ง What Are Particles?
Particles are clients that connect to a Reactor.
Each type offers a specific balance between throughput, latency, and concurrency safety.
| Particle Type | Description | Thread Safety | Reliability | Throughput | Typical Use |
|---|---|---|---|---|---|
| Particle | Async client (single-threaded) using ValueTask SendAsync. |
๐ซ No | โ Reliable | โ๏ธ Moderate | RPCs, control messages |
| ParticleFlux | Concurrent async client (multi-threaded safe). | โ Yes | โ Reliable | ๐ High | Parallel telemetry streams |
| ParticleBurst | Fire-and-forget, lock-free burst sender. | โ Yes | โ ๏ธ Unreliable (no await) | โก Extreme | Market data, tick streams, sensor bursts |
๐งฉ Example โ Reactor + Particle
Reactor (Server)
using Faster.Transport;
using System.Net;
var reactor = new Reactor(new IPEndPoint(IPAddress.Any, 5555));
reactor.OnReceived = (conn, data) =>
{
// Echo message back
conn.Return(data);
};
reactor.OnConnected = conn => Console.WriteLine("New client connected!");
reactor.Start();
Console.WriteLine("Reactor started on port 5555.");
Console.ReadLine();
Particle (Async Client)
using Faster.Transport;
using System.Net;
using System.Text;
var particle = new ParticleBuilder()
.ConnectTo(new IPEndPoint(IPAddress.Loopback, 5555))
.OnReceived(data => Console.WriteLine("Echo: " + Encoding.UTF8.GetString(data.Span)))
.OnParticleDisconnected((cli, ex) => Console.WriteLine("Disconnected: " + ex?.Message))
.Build();
await particle.SendAsync(Encoding.UTF8.GetBytes("Hello Reactor!"));
โก Example โ ParticleBurst (Fire-and-Forget)
using Faster.Transport;
using System.Net;
using System.Text;
var burst = new ParticleBuilder()
.ConnectTo(new IPEndPoint(IPAddress.Loopback, 5555))
.AsBurst()
.WithParallelism(32)
.OnBurstDisconnected((cli, ex) => Console.WriteLine("Burst disconnected: " + ex?.Message))
.BuildBurst();
var payload = Encoding.UTF8.GetBytes("Hello Reactor โก");
// Send 100k messages as fast as possible
for (int i = 0; i < 100_000; i++)
{
burst.Send(payload);
}
๐งฐ Features
โ
Zero-copy, framed protocol
โ
Lock-free buffer management (ConcurrentBufferManager)
โ
Pooled SocketAsyncEventArgs for zero allocation
โ
High-performance frame parser with inline feed
โ
Full duplex I/O
โ
Supports hundreds of concurrent connections
โ
Works with .NET Framework 4.8 and .NET 6+
โ๏ธ Configuration via ParticleBuilder
| Method | Description |
|---|---|
.ConnectTo(EndPoint) |
Sets the remote endpoint |
.WithBufferSize(int) |
Controls per-message buffer slice |
.WithParallelism(int) |
Controls internal pool scaling |
.AsConcurrent() |
Enables thread-safe concurrent sends |
.AsBurst() |
Enables fire-and-forget mode |
.OnReceived(Action<ReadOnlyMemory<byte>>) |
Handles received frames |
.OnParticleDisconnected(...) |
Handles disconnect for async particles |
.OnBurstDisconnected(...) |
Handles disconnect for burst particles |
๐ฆ Example Project Scenarios
| Scenario | Recommended |
|---|---|
| Command/Control API | ๐งฉ Particle |
| Multi-threaded telemetry upload | ๐ ParticleFlux |
| Firehose of tick or sensor data | โก ParticleBurst |
| Server or message router | ๐ง Reactor |
๐งช Performance Targets (on modern hardware)
| Metric | ParticleFlux | ParticleBurst |
|---|---|---|
| Throughput | ~3โ5 million msgs/sec | ~10+ million msgs/sec |
| Latency | ~40 ยตs (99%) | ~25 ยตs (99%) |
| Allocations | Zero | Zero |
(Tested with 8192-byte payloads on loopback with 32 parallel senders.)
๐งฉ License
MIT ยฉ Faster.Transport
Engineered for speed, stability, and real-time data flow.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- No dependencies.
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Faster.Transport:
| Package | Downloads |
|---|---|
|
Faster.Messagebus
A high-performance, low-allocation messaging bus for .NET, built on NetMQ for transport and MessagePack for efficient serialization. Designed for speed and ease of use in distributed systems. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.0.21 | 274 | 11/14/2025 |
| 0.0.20 | 170 | 11/8/2025 |
| 0.0.19 | 163 | 11/8/2025 |
| 0.0.18 | 344 | 11/4/2025 |
| 0.0.17 | 219 | 11/2/2025 |
| 0.0.16 | 212 | 11/2/2025 |
| 0.0.15 | 142 | 11/1/2025 |
| 0.0.14 | 209 | 10/29/2025 |
| 0.0.13 | 209 | 10/29/2025 |
| 0.0.12 | 205 | 10/29/2025 |
| 0.0.11 | 207 | 10/29/2025 |
| 0.0.10 | 158 | 10/26/2025 |
| 0.0.9 | 160 | 10/26/2025 |
| 0.0.8 | 148 | 10/24/2025 |
| 0.0.7 | 200 | 10/23/2025 |
| 0.0.6 | 199 | 10/23/2025 |
| 0.0.5 | 197 | 10/23/2025 |
| 0.0.4 | 186 | 10/23/2025 |
| 0.0.3 | 204 | 10/23/2025 |
| 0.0.2 | 202 | 10/23/2025 |