SuperSocket.WebSocket.Server 2.0.2

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

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

Package Downloads
SuperSocket.WebSocketServer

A WebSocket Server base on SuperSocket.

MTD.BM.Common

此模块为MTD系统基础模块,包含多个组件

Library.SuperSocket

Supersocket推展 黑名单 JT协议

Apricot.Net.WebSocket

WebSocket Middleware、SuperWebSocket、SignalR

Micro.WebSocket

Micro.WebSocket:ijlynivfhp

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on SuperSocket.WebSocket.Server:

Repository Stars
kerryjiang/WebSocket4Net
A popular .NET WebSocket Client
Version Downloads Last Updated
2.0.2 0 7/10/2025
2.0.1 517 5/24/2025
2.0.0 482 4/20/2025
2.0.0-beta.31 401 4/2/2025
2.0.0-beta.30 323 1/26/2025
2.0.0-beta.28 474 11/2/2024
2.0.0-beta.27 175 9/30/2024
2.0.0-beta.26 641 8/31/2024
2.0.0-beta.25 227 8/21/2024
2.0.0-beta.24 803 6/29/2024
2.0.0-beta.23 1,119 6/1/2024
2.0.0-beta.22 1,184 5/25/2024
2.0.0-beta.21 294 5/4/2024
2.0.0-beta.20.448 681 4/14/2024
2.0.0-beta.18 3,871 8/30/2023
2.0.0-beta.17 1,552 6/4/2023
2.0.0-beta.16 313 5/10/2023
2.0.0-beta.15 899 3/5/2023
2.0.0-beta.14 1,540 2/21/2023
2.0.0-beta.13 575 1/17/2023
2.0.0-beta.12 17,994 10/30/2022
2.0.0-beta.11 3,504 5/6/2022
2.0.0-beta.10 20,693 5/29/2021
2.0.0-beta.9 288 5/26/2021
2.0.0-beta.8 9,156 1/23/2021