Faster.Transport 0.0.10

There is a newer version of this package available.
See the version list below for details.
dotnet add package Faster.Transport --version 0.0.10
                    
NuGet\Install-Package Faster.Transport -Version 0.0.10
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Faster.Transport" Version="0.0.10" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Faster.Transport" Version="0.0.10" />
                    
Directory.Packages.props
<PackageReference Include="Faster.Transport" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Faster.Transport --version 0.0.10
                    
#r "nuget: Faster.Transport, 0.0.10"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Faster.Transport@0.0.10
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Faster.Transport&version=0.0.10
                    
Install as a Cake Addin
#tool nuget:?package=Faster.Transport&version=0.0.10
                    
Install as a Cake Tool

๐Ÿš€ 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

๐Ÿงฐ Core Concepts

๐Ÿงฉ 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);
}

This guarantees plug-and-play interchangeability between TCP, UDP, IPC, and Inproc implementations.


๐Ÿงช Quick Start โ€” Building a Transport Instance

ParticleBuilder provides a unified fluent API for all modes.

var particle = new ParticleBuilder()
    .UseMode(TransportMode.Tcp)
    .ConnectTo(new IPEndPoint(IPAddress.Loopback, 9000))
    .OnConnected(p => Console.WriteLine("Connected!"))
    .OnReceived((p, data) => Console.WriteLine($"Received {data.Length} bytes"))
    .Build();

Supported Transport Modes

Enum Transport Description
TransportMode.Inproc In-process zero-copy Sub-microsecond message latency
TransportMode.Ipc Shared-memory IPC 10ร— faster than named pipes
TransportMode.Tcp Reliable socket transport Classic client/server networking
TransportMode.Udp Datagram transport (unicast/multicast/broadcast) Real-time streaming or telemetry

โšก TCP Example

var client = new ParticleBuilder()
    .UseMode(TransportMode.Tcp)
    .ConnectTo(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!"));

๐Ÿ“ก UDP Example โ€” Full-Duplex Mode

Single socket handles both send and receive operations efficiently.

var port = 9700;
var udp = new ParticleBuilder()
    .UseMode(TransportMode.Udp)
    .BindTo(new IPEndPoint(IPAddress.Any, port))
    .ConnectTo(new IPEndPoint(IPAddress.Loopback, port))
    .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)
    .EnableMulticast(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!"));

๐Ÿ’ก Tip: Set disableLoopback: true to avoid 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 memory-mapped files 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());

โš™๏ธ Benchmark Results (.NET 9, x64, Release)

Transport Scenario Messages Mean Allocated Notes
๐Ÿง  Inproc 10k async messages 10 000 5.08 ms ๐Ÿ† 956 KB Lock-free ring buffer
๐Ÿงฉ IPC 10k async messages 10 000 17.69 ms 776 B Shared memory (MMF)
๐Ÿ“ก UDP 10k datagrams 10 000 76.82 ms 1.3 MB Multicast capable

All benchmarks performed using BenchmarkDotNet on .NET 9.0
CPU: AMD Ryzen 9 5950X | 64 GB DDR4 | Windows 11 x64


โš™๏ธ Common Builder Options

Method Description
.UseMode(TransportMode) Select transport backend
.BindTo(EndPoint) Sets local socket endpoint
.ConnectTo(EndPoint) Defines remote target
.EnableMulticast(IPAddress, port, disableLoopback) Joins a multicast group
.AllowBroadcast(bool) Enables UDP broadcast mode
.WithChannel(string, bool) Sets shared channel name for IPC/Inproc
.WithBufferSize(int) Sets internal buffer size
.WithParallelism(int) Controls parallel async sends
.OnReceived(Action<IParticle, ReadOnlyMemory<byte>>) Handles incoming data
.OnConnected(Action<IParticle>) Invoked when ready
.OnDisconnected(Action<IParticle>) Invoked when closed

๐Ÿ” Keywords for Developers & SEO

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 systems ยท Game networking ยท Simulation ยท Distributed telemetry ยท Robotics ยท HFT


๐Ÿงพ License

MIT ยฉ 2025 โ€” Faster.Transport Team
Optimized for real-time, low-latency, high-throughput distributed systems.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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 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
Loading failed