EnjoySockets 1.4.2
dotnet add package EnjoySockets --version 1.4.2
NuGet\Install-Package EnjoySockets -Version 1.4.2
<PackageReference Include="EnjoySockets" Version="1.4.2" />
<PackageVersion Include="EnjoySockets" Version="1.4.2" />
<PackageReference Include="EnjoySockets" />
paket add EnjoySockets --version 1.4.2
#r "nuget: EnjoySockets, 1.4.2"
#:package EnjoySockets@1.4.2
#addin nuget:?package=EnjoySockets&version=1.4.2
#tool nuget:?package=EnjoySockets&version=1.4.2
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
MemoryPackand 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 | Versions 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. |
-
net6.0
- MemoryPack (>= 1.21.4)
-
net8.0
- MemoryPack (>= 1.21.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.