SocketJack 2026.15.0

dotnet add package SocketJack --version 2026.15.0
                    
NuGet\Install-Package SocketJack -Version 2026.15.0
                    
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="SocketJack" Version="2026.15.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="SocketJack" Version="2026.15.0" />
                    
Directory.Packages.props
<PackageReference Include="SocketJack" />
                    
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 SocketJack --version 2026.15.0
                    
#r "nuget: SocketJack, 2026.15.0"
                    
#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 SocketJack@2026.15.0
                    
#: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=SocketJack&version=2026.15.0
                    
Install as a Cake Addin
#tool nuget:?package=SocketJack&version=2026.15.0
                    
Install as a Cake Tool

SocketJack

⚡ SocketJack 2026

Typed messages · Reliable UDP · HTTP & WebSockets · One-port protocol hosting

NuGet Downloads Build & publish License: MIT

📦 Install · ✨ What's new · 🧭 Features · 📚 Documentation


SocketJack is a .NET networking library for sending typed objects, hosting HTTP APIs, connecting browser clients, and routing peers. It supplies framing, serialization, segmentation, compression, callbacks, and connection metadata so you can build the application on top.

🔌 Connect 🌐 Host 📡 Exchange 🛠️ Integrate
TCP · UDP · reliable UDP HTTP · WebSocket · multiple protocols Typed messages · broadcasts · peer routing TypeScript generation · SFTP · WPF companion

📦 Install

dotnet add package SocketJack --version 2026.15.0
Package Target Purpose
SocketJack .NET Standard 2.1 Core networking library; this release is 2026.15.0.
SocketJack.WPF Windows / WPF Companion package for live control capture and remote input; versioned separately.

🚀 First connection — typed TCP messages

Register a callback before connecting. Run the server and client in separate applications, or together while experimenting:

using System;
using SocketJack.Net;

// This example deliberately accepts anonymous text, with peer routing disabled.
var options = new NetworkOptions { UsePeerToPeer = false };
options.Authorization.AnonymousMessageTypes.Add(typeof(string));
using var server = new TcpServer(options, 12345);
server.RegisterCallback<string>(e =>
{
    Console.WriteLine(e.Object);
    e.Connection.Send("Received ✓");
});
server.Listen();

using var client = new TcpClient(new NetworkOptions { UsePeerToPeer = false });
client.RegisterCallback<string>(e => Console.WriteLine(e.Object));
if (await client.Connect("127.0.0.1", 12345))
    client.Send("Hello, SocketJack!");
Console.ReadLine();

Keep the host application running while connections are in use. Use matching serialization and compression settings on both endpoints.

✨ What's new in 2026.14

This release refreshes the documentation and publishing checks for the recent networking updates. Read each feature below for behavior, configuration, and limits.

Feature What changed
🛡️ Authorization Default-deny peer control and redirects; administrative commands require a verified Administrator role and an explicit policy.
🔒 SafeMode Automatically fingerprinted DLLs and a client manifest checked during handshaking, without exposing server fingerprints.
📡 Reliable UDP Opt-in reliable sessions, indexed fragments, selective retransmission, and independent or ordered delivery.
🧩 Binary serialization Custom SB format, compact integers, direct byte arrays, and type whitelist validation.
📂 Verified transfers Chunked stream/file delivery with 64-bit offsets and SHA-256 verification.
🔐 SSH.NET 2026.0.0 Updated dependency powering SocketJack's SFTP client integration.
🟦 TypeScript generation Generate a client from mapped HTTP routes and emit whitelisted WebSocket message types.
✅ Trusted Publishing GitHub identity obtains a short-lived NuGet credential; no stored publish API key is required.

🛡️ Authentication and safe type activation

SafeMode is enabled by default. Register each application contract assembly and SocketJack automatically SHA-256 hashes its reflected DLL location (or matching embedded DLL resource). Type names and client DLL fingerprints must match the server during handshaking. No server fingerprint is returned. Invalid clients are disconnected before typed messages are dispatched.

Authentication is a separate step. A server verifies credentials, then calls SetAuthenticatedPrincipal over encrypted TLS. Peer redirects and control messages require explicit authorization callbacks. Administrative DTOs require the Administrator role plus an operation policy and cannot be redirected between peers. Remote CLR reflection endpoints reject invocation. Allowlisted constructors, setters, converters, and application handlers remain trusted code.

Configuration, login flow, limitations and migration

🧭 Feature explorer

📡 Reliable UDP — fragments, acknowledgments, retries & ordering

UDP_Reliable adds a reliable session layer to SocketJack UDP. Ordinary UDP remains the default, and existing applications opt in explicitly.

  • ✓ Indexed reassembly: fragments are placed at their indexed positions; duplicate packets are suppressed.
  • ↻ Selective retries: missing data is retransmitted, with bounded queues and receiver backpressure.
  • ⇄ Independent delivery: the default allows complete messages to proceed independently; callbacks must be thread-safe.
  • ≡ Ordered delivery: set Ordering = true when callbacks must follow admission order.
  • 📊 Statistics: inspect wire bytes, retries, queued payload, and smoothed RTT through ReliableStatistics.
using SocketJack.Net;
using SocketJack.Serialization;

var options = new NetworkOptions
{
    Serializer = new BinarySerializer(),
    UdpReliable = new UdpReliableOptions
    {
        Ordering = false,
        DatagramSize = 1200,
        BufferSize = 32768
    }
};
var client = UDP_Reliable.CreateClient(options);

Configure a matching reliable server with its own options instance. SendAsync waits for remote transport acceptance, not successful application processing or durable storage; use an explicit application reply for that guarantee.

Limits: reliability does not provide encryption. The recorded loopback benchmarks did not meet the goal of outperforming TCP on both throughput and latency. Choose this transport for its delivery behavior and measure your own workload.

📖 API, configuration & limits

🧩 Serialization — JSON by default, compact binary when selected

System.Text.Json remains the default. Select SocketJack.Serialization.BinarySerializer through NetworkOptions.Serializer on both peers to use SocketJack's versioned SB wire format.

Encoding feature Behavior
Compact integers Variable-length integer encoding reduces metadata size.
Byte arrays Encoded directly instead of converting payload bytes into JSON text.
Uncommon types JSON fallback retains support beyond the specialized binary cases.
Type validation Decoded wrappers continue through SocketJack's type whitelist checks.

This is a custom serializer, not BinaryFormatter. Register message callbacks or whitelist message types before sending, including nested types where required. Serializer and compression choices must agree between endpoints.

📂 Stream & file transfer — bounded chunks and verified completion

Reliable UDP supports stream/file transfers without materializing an entire file as one message. Transfer frames use bounded chunks, 64-bit byte offsets, SHA-256 verification, and explicit destination acceptance.

The per-I/O buffer cap is 32 KiB, not a total-file size limit. Whole-object messages still have separate memory budgets. Configure delivery timeouts and destination handling for your workload; transport acceptance alone does not establish successful storage.

📖 Transfer APIs and receiver requirements

🔐 SSH.NET 2026.0.0 — SFTP client integration

SocketJack now references SSH.NET 2026.0.0. SocketJack.Net.SftpClient wraps SSH.NET for remote file operations:

  • 🔑 Authentication: password and private-key options, including encrypted-key passphrases.
  • 📁 Directory operations: list, create, change, rename, and delete.
  • ⇅ File operations: upload/download with progress callbacks; open read/write streams.
  • ⚙️ Metadata: inspect and update SFTP file attributes.
  • ⏱️ Configuration: host, port, username, and connection timeout through SftpClientOptions.

The convenience async methods wrap synchronous work with Task.Run; they are not a separate native asynchronous transport. SFTP server hosting requires an ISftpServerBackend implementation; SocketJack does not bundle an SSH server.

📖 SFTP implementation · 📦 SSH.NET package

🟦 TypeScript — generate clients from mapped HTTP routes

HttpServer.GenerateTypeScriptClient() emits a dependency-free TypeScript client from the server's currently mapped routes. Typed request bodies become TypeScript aliases, path variables become required inputs, and resolvable whitelisted message classes can be emitted as interfaces for WebSocket use.

using System.IO;
using SocketJack.Net;

var server = new HttpServer(port: 8080);
server.Map("GET", "/health", (connection, request, ct) => new { status = "ok" });

File.WriteAllText("SocketJackClient.ts", server.GenerateTypeScriptClient(
    new TypeScriptClientOptions
    {
        ClassName = "ApiClient",
        BaseUrl = "http://localhost:8080",
        IncludeWebSocketTypes = true
    }));

Generate after registering routes. Review generated contracts whenever the server API changes.

🔌 TCP & ordinary UDP — typed callbacks, replies and broadcasts

TcpClient / TcpServer provide framed object messaging over TCP. UdpClient / UdpServer provide the typed callback model for datagrams. Use RegisterCallback<T>() to receive a message, reply through its connection, or broadcast through the server.

TCP suits ordered streams and general application traffic. Ordinary UDP suits discovery and lightweight updates where applications tolerate loss. Select reliable UDP explicitly when you need its session delivery semantics.

🌐 HTTP & WebSockets — APIs, static files and realtime clients

HttpServer maps methods and paths to handlers, supports typed request bodies, and serves files, directories, redirects, uploads, and streaming responses. WebSocket clients and servers connect browser applications and native peers to typed callbacks and peer metadata.

var server = new SocketJack.Net.HttpServer(port: 8080);
server.Map("GET", "/health", (connection, request, ct) => new { status = "ok" });
server.MapDirectory("/static", @"C:\wwwroot");
server.Listen();

🔀 Protocol multiplexing — multiple protocols on one listener

MutableTcpServer detects and dispatches supported protocol traffic on one listening port. The repository includes HTTP, WebSocket, native SocketJack, RTMP, SQL/TDS, and FTP surfaces, with custom protocol handlers for extensions.

Every protocol is disabled by default. Add only the required names to the server's EnabledProtocols whitelist before listening:

var server = new MutableTcpServer(8080);
server.EnabledProtocols.Add(MutableTcpProtocols.Http);
server.EnabledProtocols.Add(MutableTcpProtocols.WebSocket);
server.Listen();

SQL/TDS additionally defaults to loopback-only access. Use server.SqlOptions.RemoteAccess to explicitly allow private-network or public clients, or add individual addresses to AllowedRemoteIpAddresses. SFTP runs over SSH and needs the separate backend described above; it is not supplied by ordinary TCP protocol detection.

🤝 Peer routing & metadata — discovery and coordinated delivery

Associate identity and metadata with peers, update that metadata during a connection, and route messages through a coordinating server. This supports room lists, capability registries, service discovery, and peer-directed application traffic. Server-mediated redirects are distinct from a direct peer connection.

🗄️ Data & streaming — SQL surfaces, management routes and RTMP

The repository includes data-server primitives, SQL/TDS handling, HTTP management routes, and RTMP ingest/relay support. These components can support embedded administration, application records, and media workflows alongside native SocketJack messaging.

See the examples and component source for configuration and supported protocol behavior.

🖥️ WPF companion — live controls and remote input

The separately versioned SocketJack.WPF package shares FrameworkElement content as a live image stream and forwards mouse, wheel, text, and keyboard input.

using SocketJack.WPF;

IDisposable shareHandle = GameCanvas.Share(client, remotePeer, fps: 10);
IDisposable viewerHandle = client.ViewShare(SharedImage, sharerPeer);

This fragment assumes an existing WPF application, connection, and peer references. Dispose the handles to stop sharing/viewing. The current core publishing workflow does not republish the WPF companion.

✅ Publishing & dependency checks — short-lived credentials

The release workflow builds on Linux and Windows, packs SocketJack, and publishes to NuGet and GitHub Packages. NuGet Trusted Publishing exchanges GitHub's workflow identity for a temporary credential using NuGet/login.

Before packaging, restore audits direct and transitive dependencies. Known vulnerability warnings and audit-feed failures block the core release. Package audits report known advisories at the time of the check; they do not prove the absence of all security defects.

📚 Documentation

Resource What you'll find
📘 Examples Longer transport and utility examples.
📡 Reliable UDP guide Options, transfer APIs, limits, and acceptance semantics.
📊 Reliable UDP benchmark results TCP comparison, confidence intervals, acceptance limits, and raw measurements.
🧩 Binary serializer benchmark results Custom SB encoding/decoding, JSON comparison, allocations, wrapping, and reproduction commands.
🧪 GitHub Actions Build and publishing results.
📦 NuGet Published versions and dependencies.

🗺️ Repository map

Directory Role
SocketJack/ Core networking and package README.
SocketJack.Tests/ Protocol and HTTP integration tests.
SocketJack.UdpReliable.Tests/ Reliable UDP correctness and impairment tests.
SocketJack.Windows/ WPF companion.
SocketJack.WpfBasicGame/ WPF example application.
docs/ Protocol guides, benchmarks, and release notes.

⚖️ License: MIT

Product 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 netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on SocketJack:

Package Downloads
ProjectZ

An XNA UI Framework that runs on modern .NET 8.0

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2026.15.0 31 10/2/2026
2026.14.1 50 10/1/2026
2026.10.0 123 8/9/2026
2026.8.0 155 7/10/2026
2026.7.0 145 6/29/2026
2026.3.0 158 6/18/2026
2026.1.0 138 6/7/2026
2026.0.0 135 5/30/2026
2.0.0 144 5/6/2026
1.7.2 130 5/5/2026
1.6.7 169 3/9/2026
Loading failed

2026.15 requires explicit MutableTcpServer protocol enablement, defaults SQL access to local clients, and supports automatic local DLL fingerprint discovery including embedded assemblies. Reliable UDP and binary serializer benchmark documentation remains included in the repository.