Faster.Transport
0.0.21
dotnet add package Faster.Transport --version 0.0.21
NuGet\Install-Package Faster.Transport -Version 0.0.21
<PackageReference Include="Faster.Transport" Version="0.0.21" />
<PackageVersion Include="Faster.Transport" Version="0.0.21" />
<PackageReference Include="Faster.Transport" />
paket add Faster.Transport --version 0.0.21
#r "nuget: Faster.Transport, 0.0.21"
#:package Faster.Transport@0.0.21
#addin nuget:?package=Faster.Transport&version=0.0.21
#tool nuget:?package=Faster.Transport&version=0.0.21
π Faster.Transport β High-Performance Transport Framework for .NET
Unified Real-Time Transport Layer for .NET 6β9 Applications
The fastest way to build zero-copy, low-latency, full-duplex communication across TCP, UDP, IPC, and In-Process backends.
Faster.Transport delivers a unified abstraction β IParticle β that powers all modes:
- π§ Inproc β ultra-fast in-memory messaging within one process
- π§© IPC β shared-memory communication across processes
- β‘ TCP β reliable, framed, full-duplex network transport
- π‘ UDP β lightweight, multicast-capable datagram transport
β All transport modes share:
- Unified async + sync APIs
- Zero-allocation send/receive
- Zero-copy buffer reuse
- Consistent event-driven model
π§± Architecture Overview
| Transport | Description | Best Use | Backing Technology |
|---|---|---|---|
| π§ Inproc | In-memory transport within a single process | Internal pipelines, subsystems | Lock-free MPSC queue |
| π§© IPC | Cross-process shared-memory transport | Multi-process backends | Memory-mapped files + SPSC rings |
| β‘ TCP | Reliable, ordered, framed byte stream | External services, LAN/WAN | Async Sockets (length-prefixed frames) |
| π‘ UDP | Lightweight, low-latency datagrams | Telemetry, discovery, broadcast | Datagram sockets with multicast |
π§© IParticle β Unified Transport Interface
Every transport implements the same high-performance contract:
public interface IParticle : IDisposable
{
Action<IParticle, ReadOnlyMemory<byte>>? OnReceived { get; set; }
Action<IParticle>? OnDisconnected { get; set; }
Action<IParticle>? OnConnected { get; set; }
ValueTask SendAsync(ReadOnlyMemory<byte> payload);
void Send(ReadOnlySpan<byte> payload);
}
All modes (TCP, UDP, IPC, Inproc) share this exact API and semantics.
βοΈ Builders Overview
There are two primary builders:
| Builder | Role | Description |
|---|---|---|
π§± ReactorBuilder |
Server | Creates a multi-client server βreactorβ that spawns IParticle peers automatically. |
βοΈ ParticleBuilder |
Client | Creates a single transport client for any mode (TCP, UDP, IPC, Inproc). |
Both share the same fluent configuration API.
β‘ TCP Examples
π§± TCP Server (Reactor)
var server = new ReactorBuilder()
.UseMode(TransportMode.Tcp)
.WithLocal(new IPEndPoint(IPAddress.Any, 9500))
.OnConnected(p => Console.WriteLine("π’ Client connected"))
.OnReceived((p, msg) =>
{
Console.WriteLine($"Server received: {Encoding.UTF8.GetString(msg.Span)}");
p.Send("Echo"u8.ToArray());
})
.Build();
server.Start();
Console.WriteLine("β
TCP server running on port 9500");
βοΈ TCP Client
var client = new ParticleBuilder()
.UseMode(TransportMode.Tcp)
.WithRemote(new IPEndPoint(IPAddress.Loopback, 9500))
.OnConnected(p => Console.WriteLine("β
Connected to TCP server"))
.OnReceived((p, msg) =>
Console.WriteLine($"π© {Encoding.UTF8.GetString(msg.Span)}"))
.Build();
await client.SendAsync("Hello TCP!"u8.ToArray());
π‘ ReactorBuilder manages client lifetimes; each new connection spawns a dedicated IParticle.
π‘ UDP Example (Full Duplex)
var port = 9700;
var udp = new ParticleBuilder()
.UseMode(TransportMode.Udp)
.WithLocal(new IPEndPoint(IPAddress.Any, port))
.WithRemote(new IPEndPoint(IPAddress.Loopback, port))
.AllowBroadcast(true)
.OnConnected(p => Console.WriteLine("π‘ UDP ready"))
.OnReceived((p, msg) =>
Console.WriteLine($"π¨ {Encoding.UTF8.GetString(msg.Span)}"))
.Build();
await udp.SendAsync("Ping via UDP!"u8.ToArray());
π UDP Multicast Example
var group = IPAddress.Parse("239.0.0.123");
var port = 9700;
var peer = new ParticleBuilder()
.UseMode(TransportMode.Udp)
.WithMulticast(group, port, disableLoopback: false)
.OnConnected(p => Console.WriteLine("β
Joined multicast group"))
.OnReceived((p, msg) =>
Console.WriteLine($"π© {Encoding.UTF8.GetString(msg.Span)}"))
.Build();
await peer.SendAsync("Hello multicast group!"u8.ToArray());
π‘ Use disableLoopback: true to suppress receiving your own datagrams.
π§ In-Process (Inproc) Example
Ultra-low-latency in-memory communication within the same process (no syscalls).
// Server
var server = new ReactorBuilder()
.UseMode(TransportMode.Inproc)
.WithChannel("demo")
.OnReceived((p, msg) =>
{
Console.WriteLine($"[Server] {Encoding.UTF8.GetString(msg.Span)}");
p.Send("Echo"u8.ToArray());
})
.Build();
// Client
var client = new ParticleBuilder()
.UseMode(TransportMode.Inproc)
.WithChannel("demo")
.OnReceived((p, msg) =>
Console.WriteLine($"[Client] {Encoding.UTF8.GetString(msg.Span)}"))
.Build();
server.Start();
await client.SendAsync("Ping"u8.ToArray());
π‘ Inproc mode uses a lock-free MPSC queue with hybrid event-driven polling.
π§© IPC Example β Cross-Process Messaging
High-performance interprocess communication using shared memory and ring buffers.
// Server
var server = new ReactorBuilder()
.UseMode(TransportMode.Ipc)
.WithChannel("shared-mem")
.OnReceived((p, msg) =>
{
Console.WriteLine($"[Server] {Encoding.UTF8.GetString(msg.Span)}");
p.Send("Ack"u8.ToArray());
})
.Build();
// Client
var client = new ParticleBuilder()
.UseMode(TransportMode.Ipc)
.WithChannel("shared-mem")
.OnReceived((p, msg) =>
Console.WriteLine($"[Client] Got: {Encoding.UTF8.GetString(msg.Span)}"))
.Build();
server.Start();
await client.SendAsync("Hi IPC!"u8.ToArray());
π‘ IPC mode uses shared memory + SPSC ring buffers and supports multiple clients per reactor.
βοΈ Common Builder Options
| Method | Description |
|---|---|
.UseMode(TransportMode) |
Select transport backend (TCP, UDP, IPC, Inproc) |
.AsServer(bool) |
Explicitly mark as server (alternative to ReactorBuilder) |
.WithLocal(IPEndPoint) |
Bind address for TCP/UDP |
.WithRemote(IPEndPoint) |
Remote endpoint for TCP/UDP |
.WithMulticast(IPAddress, int, bool) |
Join a UDP multicast group |
.AllowBroadcast(bool) |
Enable UDP broadcast |
.WithChannel(string, bool) |
Channel name for IPC/Inproc |
.WithBufferSize(int) |
Per-connection buffer size |
.WithParallelism(int) |
Control async send parallelism |
.WithTcpBacklog(int) |
TCP backlog size |
.WithAutoReconnect(double, double) |
Automatic reconnect (minDelay, maxDelay in seconds) |
.OnReceived(Action<IParticle, ReadOnlyMemory<byte>>) |
Message handler |
.OnConnected(Action<IParticle>) |
Connection established |
.OnDisconnected(Action<IParticle>) |
Connection closed |
π§ͺ Benchmark Results (.NET 9, x64, Release)
| Transport | Scenario | Messages | Mean | Allocated | Notes |
|---|---|---|---|---|---|
| π§ Inproc | 10k async messages | 10 000 | 0.8 ms π | 956 KB | Lock-free MPSC queue |
| π§© IPC | 10k async messages | 10 000 | 1.8 ms | 184 B | Shared memory (MMF) |
| β‘ TCP | 10k async messages | 10 000 | 76.8 ms | 1.3 MB | SAEA framed protocol |
| π‘ UDP (Unicast) | 10k datagrams | 10 000 | 92.8 ms | 1.6 MB | Datagram sockets |
| π‘ UDP (Multicast) | 10k datagrams | 10 000 | 502.2 ms | 1.6 MB | Multicast group |
Tested with BenchmarkDotNet on .NET 9.0,
CPU: AMD Ryzen 9 5950X | 64 GB DDR4 | Windows 11 x64
π Keywords for Developers
Tags:
.NET transport layer, zero-copy IPC, shared memory,
low latency TCP, UDP multicast, async sockets,
real-time telemetry, lock-free ring buffer, C# networking
Use Cases:
Real-time trading Β· Game networking Β· Simulation Β· Distributed telemetry Β· Robotics Β· HFT systems
π§Ύ License
MIT Β© 2025 β Faster.Transport Team
Optimized for real-time, low-latency, and high-throughput distributed systems.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 is compatible. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 is compatible. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 4.8
- CommunityToolkit.HighPerformance (>= 8.4.0)
- MessagePack (>= 3.1.4)
- NetMQ (>= 4.0.2.2)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Threading.Tasks.Extensions (>= 4.6.3 && < 5.0.0)
-
.NETStandard 2.0
- CommunityToolkit.HighPerformance (>= 8.4.0)
- MessagePack (>= 3.1.4)
- NetMQ (>= 4.0.2.2)
- System.Memory (>= 4.6.3)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Threading.Tasks.Extensions (>= 4.6.3 && < 5.0.0)
-
.NETStandard 2.1
- CommunityToolkit.HighPerformance (>= 8.4.0)
- MessagePack (>= 3.1.4)
- NetMQ (>= 4.0.2.2)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
-
net9.0
- CommunityToolkit.HighPerformance (>= 8.4.0)
- MessagePack (>= 3.1.4)
- NetMQ (>= 4.0.2.2)
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 |