11
yanjinhui
2025-04-30 752223f279965b562e3d086b78f01efb55925ae4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
 
using HslCommunication.WebSocket;
 
namespace WIDESEAWCS_Server.Filter
{
    public class WebSocketHostService : IHostedService
    {
        WebSocketServer _webSocketServer;
         public WebSocketHostService(WebSocketServer webSocketServer)
        {
            _webSocketServer = webSocketServer;
        }
 
        public Task StartAsync(CancellationToken cancellationToken)
        {
            _webSocketServer.PublishAllClientPayload("程序启动");
            return Task.CompletedTask;
        }
 
        public Task StopAsync(CancellationToken cancellationToken)
        {
            return Task.CompletedTask;
        }
    }
}