SuperSocketLite2 0.22.0

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

SuperSocketLite2

Async TCP/UDP socket server library for .NET 10 (Windows/Linux), built for the kind of workload that doesn't forgive sloppy I/O: real-time multiplayer game servers. A session-based, event-driven framework on top of SocketAsyncEventArgs (IOCP) and System.IO.Pipelines, so you can focus on your game protocol instead of reinventing connection management, buffer pooling, and backpressure handling.

This is a separate, from-scratch NuGet package — a different package ID from the older SuperSocketLite package (still the pre-rewrite, .NET 9 line). Installing this one does not affect existing SuperSocketLite users.

Install

dotnet add package SuperSocketLite2

A minimal echo server

public sealed class MyRequestInfo : IRequestInfo
{
    public string Key => string.Empty;
    public ReadOnlySequence<byte> Body { get; private set; }
    public void Set(ReadOnlySequence<byte> body) => Body = body;
}

public sealed class MyReceiveFilter : FixedHeaderReceiveFilter<MyRequestInfo>
{
    private readonly MyRequestInfo _reusable = new();
    public MyReceiveFilter() : base(4) { }

    protected override int GetBodyLengthFromHeader(ReadOnlySequence<byte> header)
    {
        Span<byte> buffer = stackalloc byte[4];
        header.CopyTo(buffer);
        return BinaryPrimitives.ReadInt32LittleEndian(buffer);
    }

    protected override MyRequestInfo ResolveRequestInfo(ReadOnlySequence<byte> header, ReadOnlySequence<byte> body)
    {
        _reusable.Set(body);
        return _reusable;
    }
}

public sealed class MySession : AppSession<MySession, MyRequestInfo> { }

public sealed class MyServer : AppServer<MySession, MyRequestInfo>
{
    public MyServer() : base(new DefaultReceiveFilterFactory<MyReceiveFilter, MyRequestInfo>()) { }
}
var server = new MyServer();
server.NewRequestReceived += (session, request) =>
{
    if (request.Body.IsSingleSegment)
        session.SendCopied(request.Body.FirstSpan);
    else
        session.SendCopied(request.Body.ToArray());
};

server.Setup(new RootConfig(), new ServerConfig { Ip = "Any", Port = 2012, MaxConnectionNumber = 1000 },
    logFactory: new ConsoleLogFactory());
server.Start();

Documentation

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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
0.22.0 131 8/21/2026
0.21.1 111 8/14/2026
0.21.0 116 8/14/2026

0.22.0 — The package now ships Roslyn analyzers (SSL001-SSL007) that catch the mistakes this library punishes only under load: a RequestInfo or its body escaping the request handler (stored in a field, captured in a lambda, or read after an await), a pooled buffer handed to the zero-copy Send, ReadOnlySequence read through First.Span, an ignored Setup/Start return value, and an unchecked GetAllSessions result. They turn on as soon as you reference the package; no configuration. Companion package SuperSocketLite2.Templates adds `dotnet new sslite2-server`. No API or behaviour changes to the library itself — upgrading from 0.21.1 may surface new warnings, and every one of them is worth reading. See Docs/agent/analyzers.md.

0.21.1 — First public release of SuperSocketLite2, a from-scratch .NET 10 / System.IO.Pipelines-based rewrite. This is a separate NuGet package from the older SuperSocketLite (still the pre-rewrite .NET 9 line); installing it does not affect existing SuperSocketLite users. Windows/Linux server-side use only.