SuperSocket.ProtoBase 2.0.2

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

Release Note: SuperSocket 2.0.2

Overview

SuperSocket 2.0.2 is a major update that builds upon the foundation of v2.0.1, introducing significant performance improvements, enhanced API flexibility, and comprehensive bug fixes. This release focuses on optimizing data processing, improving dependency injection capabilities, and enhancing overall stability.

Key Improvements

Performance Enhancements

Optimized Extensions for Data Processing
  • Added LittleEndian methods for efficient byte order conversions
  • Optimized BigEndian performance with improved algorithms in Extensions.cs
  • Enhanced SequenceReader extensions with comprehensive test coverage
  • Improved memory efficiency and reduced allocations in data processing pipelines
Method Naming Optimizations
  • Optimized method naming conventions across connection classes for better clarity
  • Improved readability and consistency in the API surface
  • Enhanced developer experience with more intuitive method names

Enhanced Dependency Injection Support

Pipeline Filter Constructor Flexibility
  • Removed the new() constraint from pipeline filter type parameters
  • Enabled full dependency injection support for pipeline filters
  • Pipeline filters can now receive services through constructor injection
  • Backward compatible with existing pipeline filters that use default constructors
Affected Components

The dependency injection improvements span across:

  • ISuperSocketHostBuilder<TReceivePackage> interface
  • HostBuilderExtensions methods
  • MultipleServerHostBuilder configurations
  • SuperSocketHostBuilder static and instance methods

Connection and Session Management Improvements

IDisposable Implementation
  • Added IDisposable interfaces to IConnection and IEasyClient
  • Improved resource management and cleanup processes
  • Enhanced connection lifecycle management

Stability and Bug Fixes

Configuration and Host Builder Fixes
  • Fixed application builder compatibility issues
  • Resolved problems where non-web application builders couldn't be used as SuperSocket application builders
  • Improved host builder extensibility and configuration options
Connection Reliability
  • Added ConfigureAwait(false) to SendAsync operations for better performance
  • Improved connection handling and error recovery
  • Enhanced connection state management and cleanup

Testing and Quality Improvements

Comprehensive Test Coverage
  • Added PipelineFilterRegistrationTest for dependency injection scenarios
  • Enhanced SequenceReaderExtensionTest with new test cases
  • Improved test infrastructure with better base classes
  • Added comprehensive WebSocket testing improvements
Code Quality Enhancements
  • Added .editorconfig for consistent code formatting
  • Improved XML documentation coverage across the codebase
  • Enhanced code comments and documentation
  • Better code organization and structure

API and Framework Enhancements

Package Management
  • Updated project descriptions across all packages
  • Enhanced NuGet package metadata
  • Improved release note integration in packages
  • Better package discovery and documentation
Framework Integration
  • Improved .NET host integration capabilities
  • Enhanced middleware pipeline flexibility
  • Better service container integration
  • Improved configuration system compatibility

Breaking Changes

None - This release maintains full backward compatibility with existing SuperSocket 2.x applications.

Migration Guide

For Pipeline Filter Dependencies

If you want to leverage the new dependency injection capabilities for pipeline filters:

// Before: Only default constructors were supported
public class MyPipelineFilter : IPipelineFilter<TextPackageInfo>
{
    public MyPipelineFilter() { } // Required default constructor
}

// After: Constructor injection is now supported
public class MyPipelineFilter : IPipelineFilter<TextPackageInfo>
{
    private readonly ILogger<MyPipelineFilter> _logger;
    private readonly IConfiguration _configuration;

    public MyPipelineFilter(ILogger<MyPipelineFilter> logger, IConfiguration configuration)
    {
        _logger = logger;
        _configuration = configuration;
    }
}

// Register dependencies and use the filter
hostBuilder
    .ConfigureServices((ctx, services) => 
    {
        services.AddSingleton<IMyService, MyService>();
    })
    .AsSuperSocketHostBuilder<TextPackageInfo, MyPipelineFilter>();

Performance Benchmarks

  • Data processing improvements: Up to 15% performance improvement in byte order conversions
  • Memory allocation reduction: Reduced allocations in high-throughput scenarios
  • Connection handling: Improved connection establishment and cleanup performance

Compatibility

  • .NET 6.0+: Full support for modern .NET versions
  • Platform: Cross-platform support (Windows, Linux, macOS)
  • Backward compatibility: 100% compatible with existing SuperSocket 2.x applications
  • Dependencies: Compatible with Microsoft.Extensions.* ecosystem

Contributors

  • Kerry Jiang (@kerryjiang)
  • Copilot (@Copilot)
  • hyabean (@hyabean)

Next Steps

  • Continue performance optimizations
  • Expand documentation and examples
  • Enhanced testing coverage
  • Community feedback integration

Installation:

dotnet add package SuperSocket --version 2.0.2

Upgrade from previous versions:

dotnet add package SuperSocket --version 2.0.2
# No breaking changes - direct upgrade supported
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 is compatible.  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-android34.0 is compatible.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-ios18.0 is compatible.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-macos15.0 is compatible.  net8.0-tvos was computed.  net8.0-tvos18.0 is compatible.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-android35.0 is compatible.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-ios18.0 is compatible.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-macos15.0 is compatible.  net9.0-tvos was computed.  net9.0-tvos18.0 is compatible.  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 (31)

Showing the top 5 NuGet packages that depend on SuperSocket.ProtoBase:

Package Downloads
SuperSocket.ClientEngine

It's a .NET socket tool which can simplify the socket client developing

SuperSocket.WebSocket

SuperSocket WebSocket protocol implementation providing frame parsing, message handling, and standards-compliant WebSocket protocol support (RFC 6455) for real-time bidirectional communication.

SuperSocket.Channel

SuperSocket library to abstract underlying communications as channel with pipeline.

SuperSocket.Primitives

SuperSocket core primitive interfaces and classes that define the fundamental abstractions for network communication, session management, and message handling.

SuperSocket.Server

SuperSocket server hosting library providing the core server implementation with session management, connection handling, and integration with the .NET dependency injection system and configuration framework.

GitHub repositories (3)

Showing the top 3 popular GitHub repositories that depend on SuperSocket.ProtoBase:

Repository Stars
microsurging/surging
Surging is a micro-service engine that provides a lightweight, high-performance, modular RPC request pipeline. support Event-based Asynchronous Pattern and reactive programming ,The service engine supports http, TCP, WS,Grpc, Thrift,Mqtt, UDP, and DNS protocols. It uses ZooKeeper and Consul as a registry, and integrates it. Hash, random, polling, Fair Polling as a load balancing algorithm, built-in service governance to ensure reliable RPC communication, the engine contains Diagnostic, link tracking for protocol and middleware calls, and integration SkyWalking Distributed APM
kerryjiang/SuperSocket.ClientEngine
A .NET library which can make your socket client development easier
jianjipan/MES
这是一个用C#写的MES系统 ,用到了supersocket通信框架,以及WPF技术
Version Downloads Last Updated
2.0.2 428 7/10/2025
2.0.2-beta.1 276 5/25/2025
2.0.1 1,945 5/24/2025
2.0.0 1,558 4/20/2025
2.0.0-beta.31 551 4/2/2025
2.0.0-beta.30 1,021 1/26/2025
2.0.0-beta.28 1,454 11/2/2024
2.0.0-beta.27 3,016 9/30/2024
2.0.0-beta.26 2,163 8/31/2024
2.0.0-beta.25 711 8/21/2024
2.0.0-beta.24 1,844 6/29/2024
2.0.0-beta.23 1,522 6/1/2024
2.0.0-beta.22 1,383 5/25/2024
2.0.0-beta.21 835 5/4/2024
2.0.0-beta.20.448 1,456 4/14/2024
2.0.0-beta.18 10,638 8/30/2023
2.0.0-beta.17 4,380 6/4/2023
2.0.0-beta.16 1,050 5/10/2023
2.0.0-beta.15 6,552 3/5/2023
2.0.0-beta.14 1,747 2/21/2023
2.0.0-beta.13 7,348 1/17/2023
2.0.0-beta.12 19,534 10/30/2022
2.0.0-beta.11 8,823 5/6/2022
2.0.0-beta.10 68,271 5/29/2021
2.0.0-beta.9 621 5/26/2021
2.0.0-beta.8 19,920 1/23/2021
1.7.0.17 406,741 6/8/2017
1.7.0.16 1,911 5/29/2017
1.7.0.15 2,375 3/22/2017
1.7.0.14 2,465 3/8/2017
1.7.0.13 4,683 12/30/2016
1.7.0.12 7,369 8/27/2016
1.7.0.11 3,856 8/11/2016
1.7.0.10 1,943 8/5/2016
1.7.0.9 1,573 8/4/2016
1.7.0.8 2,494 7/27/2016
1.7.0.7 2,413 6/28/2016
1.7.0.5 3,856 4/16/2016
1.7.0-beta7 1,512 6/22/2016
1.7.0-beta6 1,537 5/30/2016