Faster.Transport 0.0.4

There is a newer version of this package available.
See the version list below for details.
dotnet add package Faster.Transport --version 0.0.4
                    
NuGet\Install-Package Faster.Transport -Version 0.0.4
                    
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.4" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Faster.Transport" Version="0.0.4" />
                    
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.4
                    
#r "nuget: Faster.Transport, 0.0.4"
                    
#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.4
                    
#: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.4
                    
Install as a Cake Addin
#tool nuget:?package=Faster.Transport&version=0.0.4
                    
Install as a Cake Tool

โšก 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 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 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
Loading failed