1
qinchulong
2025-03-03 c3b8825e0d0cc99aeb5cc380ace9259adbc69304
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;
        }
    }
}