Skip to content

Commit

Permalink
fixed a bug in websocket host
Browse files Browse the repository at this point in the history
  • Loading branch information
kerryjiang committed Mar 16, 2024
1 parent a518ecb commit 796da04
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/SuperSocket.WebSocket.Server/WebSocketHostBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,6 +28,10 @@ public WebSocketHostBuilderAdapter(IHostBuilder hostBuilder)
protected override void RegisterDefaultServices(HostBuilderContext builderContext, IServiceCollection servicesInHost, IServiceCollection services)
{
services.TryAddSingleton<ISessionFactory, GenericSessionFactory<WebSocketSession>>();
services.TryAddSingleton<IConnectionListenerFactory, TcpConnectionListenerFactory>();
services.TryAddSingleton<SocketOptionsSetter>(new SocketOptionsSetter(socket => { }));
services.TryAddSingleton<IConnectionFactoryBuilder, ConnectionFactoryBuilder>();
services.TryAddSingleton<IConnectionStreamInitializersFactory, DefaultConnectionStreamInitializersFactory>();
}
}

Expand Down

0 comments on commit 796da04

Please sign in to comment.