wankeda
4 天以前 bde5467c641a58a51051a0ce4d2e556e5ef17441
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;
        }
    }
}