Faster.Transport
0.0.17
See the version list below for details.
dotnet add package Faster.Transport --version 0.0.17
NuGet\Install-Package Faster.Transport -Version 0.0.17
<PackageReference Include="Faster.Transport" Version="0.0.17" />
<PackageVersion Include="Faster.Transport" Version="0.0.17" />
<PackageReference Include="Faster.Transport" />
paket add Faster.Transport --version 0.0.17
#r "nuget: Faster.Transport, 0.0.17"
#:package Faster.Transport@0.0.17
#addin nuget:?package=Faster.Transport&version=0.0.17
#tool nuget:?package=Faster.Transport&version=0.0.17
๐ Faster.Transport โ High-Performance Transport Framework for .NET
Unified Real-Time Transport Layer for .NET 6โ9 Applications
Fastest way to build zero-copy, low-latency, full-duplex communication across TCP, UDP, IPC, and In-Process backends.
Faster.Transport delivers a single unified abstraction โ IParticle โ for all transport modes:
- ๐ง Inproc โ ultra-fast in-memory messaging inside a single process
- ๐งฉ IPC (Inter-Process Communication) โ high-speed shared-memory transport
- โก TCP โ reliable, framed, full-duplex network transport
- ๐ก UDP โ multicast, broadcast, and real-time datagram transport
โ All transports share:
- Unified async 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 for subsystems within one process | Internal pipelines, game engines | Lock-free ring buffer |
| ๐งฉ IPC | Cross-process communication via shared memory | Multi-process backends, simulators | Memory-mapped files + SPSC rings |
| โก TCP | Reliable, ordered, framed byte stream | External client/server comms | Async Sockets (length-prefixed frames) |
| ๐ก UDP | Lightweight, low-latency datagram transport | Real-time telemetry, broadcast, multicast | Datagram sockets with multicast groups |
๐งฉ 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, and Inproc โ share this exact API.
โ๏ธ Building Transports with ParticleBuilder
ParticleBuilder provides a unified fluent API to construct any transport โ client or server.
var particle = new ParticleBuilder()
.UseMode(TransportMode.Tcp)
.WithRemote(new IPEndPoint(IPAddress.Loopback, 9000))
.OnConnected(p => Console.WriteLine("Connected!"))
.OnReceived((p, data) => Console.WriteLine($"Received {data.Length} bytes"))
.Build();
โก TCP Examples
๐ง TCP Client
var client = new ParticleBuilder()
.UseMode(TransportMode.Tcp)
.WithRemote(new IPEndPoint(IPAddress.Loopback, 9500))
.OnConnected(p => Console.WriteLine("โ
TCP connected"))
.OnReceived((p, msg) =>
Console.WriteLine($"๐ฉ TCP: {Encoding.UTF8.GetString(msg.Span)}"))
.Build();
await client.SendAsync(Encoding.UTF8.GetBytes("Hello TCP!"));
๐งฑ TCP Server (Reactor Mode)
var server = new ParticleBuilder()
.UseMode(TransportMode.Tcp)
.AsServer(true)
.WithLocal(new IPEndPoint(IPAddress.Any, 9500))
.OnConnected(p => Console.WriteLine("๐ข Client connected"))
.OnReceived((p, msg) =>
{
Console.WriteLine($"Server got: {Encoding.UTF8.GetString(msg.Span)}");
p.Send("Echo"u8.ToArray());
})
.Build();
๐ก The TCP server uses the high-performance Reactor architecture โ
zero allocations, async accept loop, and automatic per-client Particle management.
๐ก UDP Example โ Full-Duplex Mode
Single socket handles both send and receive operations efficiently.
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(Encoding.UTF8.GetBytes("Ping via UDP!"));
๐ UDP Multicast Example
Broadcast to all peers in a multicast group โ perfect for telemetry or discovery.
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(Encoding.UTF8.GetBytes("Hello multicast group!"));
๐ก Use disableLoopback: true to prevent receiving your own packets.
๐ง In-Process (Inproc) Example
Super-fast in-memory message passing (no kernel overhead).
// Server
var server = new ParticleBuilder()
.UseMode(TransportMode.Inproc)
.WithChannel("demo", isServer: true)
.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] Reply: {Encoding.UTF8.GetString(msg.Span)}"))
.Build();
await client.SendAsync("Ping"u8.ToArray());
๐งฉ IPC Example โ Cross-Process Messaging
High-speed interprocess communication using shared memory and SPSC rings.
// Server
var server = new ParticleBuilder()
.UseMode(TransportMode.Ipc)
.WithChannel("shared-mem", isServer: true)
.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();
await client.SendAsync("Hi IPC!"u8.ToArray());
โ๏ธ Common Builder Options
| Method | Description |
|---|---|
.UseMode(TransportMode) |
Selects transport backend |
.AsServer(bool) |
Enables server mode (TCP, IPC, or Inproc) |
.WithLocal(IPEndPoint) |
Sets the local bind address |
.WithRemote(IPEndPoint) |
Sets the remote endpoint |
.WithMulticast(IPAddress, int, bool) |
Joins a UDP multicast group |
.AllowBroadcast(bool) |
Enables UDP broadcast |
.WithChannel(string, bool) |
Sets the channel name (IPC/Inproc) |
.WithBufferSize(int) |
Configures per-connection buffer size |
.WithParallelism(int) |
Controls async send parallelism |
.WithTcpBacklog(int) |
Sets TCP server backlog size |
.WithAutoReconnect(double, double) |
Enables exponential reconnect retry |
.OnReceived(Action<IParticle, ReadOnlyMemory<byte>>) |
Handler for incoming data |
.OnConnected(Action<IParticle>) |
Invoked when ready or connected |
.OnDisconnected(Action<IParticle>) |
Invoked when closed/disconnected |
๐งช 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 ring buffer |
| ๐งฉ 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 |
All benchmarks executed using BenchmarkDotNet on .NET 9.0
CPU: AMD Ryzen 9 5950X | 64 GB DDR4 | Windows 11 x64
๐ Keywords for Developers
Tags:
.NET transport layer, .NET networking, zero-copy IPC, shared memory communication,
low latency TCP, UDP multicast broadcast, async sockets,
real-time telemetry, message bus, lock-free ring buffer, C# networking library
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, 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 was computed. 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 was computed. 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. |
-
.NETStandard 2.0
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Threading.Tasks.Extensions (>= 4.5.4)
-
.NETStandard 2.1
- System.Memory (>= 4.5.5)
- System.Runtime.CompilerServices.Unsafe (>= 6.1.2)
- System.Threading.Tasks.Extensions (>= 4.5.4)
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 | 420 | 11/14/2025 |
| 0.0.20 | 244 | 11/8/2025 |
| 0.0.19 | 233 | 11/8/2025 |
| 0.0.18 | 420 | 11/4/2025 |
| 0.0.17 | 291 | 11/2/2025 |
| 0.0.16 | 280 | 11/2/2025 |
| 0.0.15 | 210 | 11/1/2025 |
| 0.0.14 | 276 | 10/29/2025 |
| 0.0.13 | 275 | 10/29/2025 |
| 0.0.12 | 282 | 10/29/2025 |
| 0.0.11 | 274 | 10/29/2025 |
| 0.0.10 | 227 | 10/26/2025 |
| 0.0.9 | 230 | 10/26/2025 |
| 0.0.8 | 223 | 10/24/2025 |
| 0.0.7 | 269 | 10/23/2025 |
| 0.0.6 | 272 | 10/23/2025 |
| 0.0.5 | 270 | 10/23/2025 |
| 0.0.4 | 265 | 10/23/2025 |
| 0.0.3 | 275 | 10/23/2025 |
| 0.0.2 | 278 | 10/23/2025 |