EnjoySockets 1.4.2

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

EnjoySockets

EnjoySockets is a lightweight, low-latency TCP runtime for C# focused on message-driven architecture, RPC routing, and predictable concurrency.

Instead of dealing with raw sockets, threading, and synchronization, you build your network layer using simple attributes and message handlers.

Built for fast client-server systems with strong thread safety, low allocations, and stable performance under load.

Features

  • Deterministic Concurrency - control execution order with attributes - globally or per connection - without manual locks.
  • Low Allocation Runtime - built-in pooling minimizes GC pressure and reduces memory overhead.
  • Backpressure & Flow Control - automatically slows senders when buffers become saturated.
  • Declarative Security - protect endpoints with attributes, payload limits, and permission-based routing.
  • Communication Patterns
    • Fire & Forget
    • Request / Response
    • Transactional messaging
  • Session Recovery & Reconnection - handles transient connection losses, ensuring operations survive and resume during client reconnection modes.
  • Serializer Friendly - works with binary serializers like MemoryPack and others.

Designed For

  • Developers who want to focus on application logic instead of socket infrastructure.
  • Applications requiring predictable message processing and safe concurrency.
  • Multiplayer, realtime, backend, and service-oriented applications.

Quick Start

EnjoySockets uses an intuitive routing engine: incoming messages are automatically routed to methods in your logic classes that match the message name.

Server Side

using EnjoySockets;

// You can generate a random key via ERSA.GeneratePrivatePublicPEM() or any other method.
string pemKeyPrivate = "-----BEGIN PRIVATE KEY-----<your_pem_key>-----END PRIVATE KEY-----";
string pemKeyPrivateSign = "-----BEGIN PRIVATE KEY-----<your_pem_key>-----END PRIVATE KEY-----";

var server = new EServer(new(pemKeyPrivate, pemKeyPrivateSign));
server.Start(EAddress.Get());

Console.ReadKey();

static class ExampleReceiveClassServer
{
    static void TestMethod(EServerSession session)
    {
        session.Send("ResponseTestMethod", Random.Shared.Next());
    }
}

Client Side

using EnjoySockets;

// Ensure these public keys match the private keys used by the server.
string pemKeyPublic = "-----BEGIN PUBLIC KEY-----<your_pem_key>-----END PUBLIC KEY-----";
string pemKeyPublicSign = "-----BEGIN PUBLIC KEY-----<your_pem_key>-----END PUBLIC KEY-----";

var client = new EClient(new(pemKeyPublic, pemKeyPublicSign));

if((await client.Connect(EAddress.Get())).IsSuccess)
	await client.Send("TestMethod");

Console.ReadKey();

static class ExampleReceiveClassClient
{
    static void ResponseTestMethod(EClient client, int luckyNumber)
    {
        Console.WriteLine($"Your lucky number from server is: {luckyNumber}");
    }
}


Full Documentation & Examples: Visit the GitHub Repository for advanced usage, RPC details, and contribution guidelines.


Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.2 116 7/7/2026
1.4.1 124 6/11/2026
1.4.0 124 6/2/2026
1.3.1 105 5/13/2026
1.3.0 106 5/13/2026
1.2.2 101 4/30/2026
1.2.1 134 4/16/2026
1.1.0 124 3/3/2026
1.0.0 125 2/27/2026