SuperSocket.Command 2.0.2

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

Showing the top 20 packages that depend on SuperSocket.Command.

Packages Downloads
SuperSocket
SuperSocket is a light weight, cross platform and extensible socket server application framework. You can use it to build a server side socket application (like game server, GPS server, industrial control system, data acquisition server etc) easily without thinking about how to use socket, how to maintain the socket connections and how socket works.
4
SuperSocket
SuperSocket is a light weight, cross platform and extensible socket server application framework. You can use it to build a server side socket application (like game server, GPS server, industrial control system, data acquisition server etc) easily without thinking about how to use socket, how to maintain the socket connections and how socket works.
5

Version Downloads Last updated
2.0.2 1 07/10/2025
2.0.2-beta.1 1 06/14/2025
2.0.1 1 06/12/2025
2.0.0 2 05/04/2025
2.0.0-beta.31 2 05/05/2025
2.0.0-beta.30 2 05/05/2025
2.0.0-beta.29 2 01/19/2025
2.0.0-beta.28 2 01/19/2025
2.0.0-beta.27 2 01/19/2025
2.0.0-beta.26 2 01/19/2025
2.0.0-beta.25 2 01/19/2025
2.0.0-beta.24 2 01/19/2025
2.0.0-beta.23 2 01/19/2025
2.0.0-beta.22 2 01/19/2025
2.0.0-beta.21 3 01/19/2025
2.0.0-beta.20.448 2 01/19/2025
2.0.0-beta.18 2 01/19/2025
2.0.0-beta.17 2 01/19/2025
2.0.0-beta.16 3 01/19/2025
2.0.0-beta.15 2 01/19/2025
2.0.0-beta.14 3 01/19/2025
2.0.0-beta.13 2 01/19/2025
2.0.0-beta.12 2 01/19/2025
2.0.0-beta.11 3 01/19/2025
2.0.0-beta.10 2 01/19/2025
2.0.0-beta.9 2 01/19/2025
2.0.0-beta.8 1 07/03/2025