SuperSocket.Connection 2.0.2-beta.1

Release Note: SuperSocket 2.0.2-beta.1

Overview

SuperSocket 2.0.2-beta.1 is a beta release that enhances the flexibility of pipeline filters by removing the constraint requiring a default constructor. This change significantly improves dependency injection support for pipeline filters across the framework.

Key Improvements

Enhanced Dependency Injection Support for Pipeline Filters

  • Removed the constraint requiring pipeline filters to have a parameterless constructor (new() constraint)
  • This change enables pipeline filters to receive dependencies through constructor injection
  • Modified all relevant method signatures across the framework to support this new flexibility

Affected Components

The new() constraint was removed from the following interfaces and methods:

  1. In ISuperSocketHostBuilder<TReceivePackage> interface:

    • UsePipelineFilter<TPipelineFilter>() method
  2. In HostBuilderExtensions class:

    • AsSuperSocketHostBuilder<TReceivePackage, TPipelineFilter>() method
  3. In MultipleServerHostBuilder class:

    • AddServer<TReceivePackage, TPipelineFilter>() method
    • AddServer<TSuperSocketService, TReceivePackage, TPipelineFilter>() method
  4. In SuperSocketHostBuilder class and static methods:

    • UsePipelineFilter<TPipelineFilter>() method
    • Create<TReceivePackage, TPipelineFilter>() methods

Compatibility

This change is backward compatible with existing code. Pipeline filters with default constructors will continue to work as before, but now you can also create pipeline filters that require dependencies to be injected.

Example Usage

With this change, you can now create pipeline filters that require dependencies:

public class MyPipelineFilter : IPipelineFilter<TextPackageInfo>
{
    private readonly ILogger<MyPipelineFilter> _logger;
    private readonly IConfiguration _configuration;

    // Constructor with dependencies - now supported!
    public MyPipelineFilter(ILogger<MyPipelineFilter> logger, IConfiguration configuration)
    {
        _logger = logger;
        _configuration = configuration;
    }

    // Implementation details...
}

// Register and use the filter
hostBuilder.AsSuperSocketHostBuilder<TextPackageInfo, MyPipelineFilter>();

Release Status

This is a beta release intended for testing. Please report any issues you encounter on the GitHub repository.

Contributors

  • Kerry Jiang

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

Packages Downloads
SuperSocket.Server.Abstractions
Package Description
1
SuperSocket.Server.Abstractions
SuperSocket library for server abstractions. It includes many interfaces and base implementation of SuperSocket server components. Users can extend server side base on this project.
1
SuperSocket.Server.Abstractions
SuperSocket library for server abstractions. It includes many interfaces and base implementation of SuperSocket server components. Users can extend server side base on this project.
2

.NET 6.0

.NET 8.0

.NET 9.0

.NET 9.0

.NET 9.0

.NET 9.0

.NET 9.0

.NET 8.0

.NET 7.0

.NET 8.0

.NET 8.0

.NET 8.0

Version Downloads Last updated
2.0.2-beta.1 1 06/03/2025
2.0.1 1 06/03/2025
2.0.0 1 05/05/2025
2.0.0-beta.31 1 05/05/2025
2.0.0-beta.30 0 01/26/2025
2.0.0-beta.28 1 05/05/2025
2.0.0-beta.27 2 05/30/2025
2.0.0-beta.26 2 05/16/2025
2.0.0-beta.25 1 05/05/2025
2.0.0-beta.24 1 05/05/2025
2.0.0-beta.23 1 06/01/2025
2.0.0-beta.22 2 05/23/2025
2.0.0-beta.21 1 05/05/2025
2.0.0-beta.20.448 1 05/05/2025