Пример #1
0
 public async Task Close()
 {
     if (_webSocketClient != null)
     {
         _logger?.Log("ChatClient will be closed!!");
         var closeTask = _webSocketClient.CloseAsync(WebSocketCloseStatus.NormalClosure, "normal", false);
         _logger?.Log($"ChatClient: {_webSocketClient.WebSocketState.ToString()}");
         await closeTask;
         _disposables.Dispose();
         _close = true;
     }
 }
 protected override Task InternalCloseAsync()
 {
     return(_client.CloseAsync());
 }