From 796da0437448e8fc38e7bdb8c690ba730c41e7e4 Mon Sep 17 00:00:00 2001 From: Kerry Jiang Date: Sat, 16 Mar 2024 12:35:35 -0700 Subject: [PATCH] fixed a bug in websocket host --- src/SuperSocket.WebSocket.Server/WebSocketHostBuilder.cs | 6 ++++++ 1 file changed, 6 insertions(+) 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(); } }