diff --git a/src/SuperSocket.WebSocket.Server/WebSocketHostBuilder.cs b/src/SuperSocket.WebSocket.Server/WebSocketHostBuilder.cs index 16cad1316..3ac114b40 100644 --- a/src/SuperSocket.WebSocket.Server/WebSocketHostBuilder.cs +++ b/src/SuperSocket.WebSocket.Server/WebSocketHostBuilder.cs @@ -3,8 +3,10 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using SuperSocket.Server; +using SuperSocket.Server.Connection; using SuperSocket.Server.Host; using SuperSocket.Server.Abstractions; +using SuperSocket.Server.Abstractions.Connections; using SuperSocket.Server.Abstractions.Session; namespace SuperSocket.WebSocket.Server @@ -26,6 +28,10 @@ public WebSocketHostBuilderAdapter(IHostBuilder hostBuilder) protected override void RegisterDefaultServices(HostBuilderContext builderContext, IServiceCollection servicesInHost, IServiceCollection services) { services.TryAddSingleton>(); + services.TryAddSingleton(); + services.TryAddSingleton(new SocketOptionsSetter(socket => { })); + services.TryAddSingleton(); + services.TryAddSingleton(); } }