Beispiel #1
0
        public async Task Remove(WebSocketKey id)
        {
            WebSocket socket;

            WebSockets.TryRemove(id, out socket);

            await socket.CloseAsync(closeStatus : WebSocketCloseStatus.NormalClosure,
                                    statusDescription : "Closed by the WebSocketCollection",
                                    cancellationToken : CancellationToken.None);
        }
Beispiel #2
0
 public WebSocketHandler(WebSocketManager manager, WebSocket webSocket, string channel)
 {
     _manager   = manager;
     _webSocket = webSocket;
     _id        = new WebSocketKey(channel);
 }