1
z8018
2025-04-08 e69f814f50fd59739dbedd88518dc8cb8d2ed3ee
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;
        }
    }
}