private async Task CloseAsync() { _state = WebSocketReadyState.Closing; await _ws.CloseAsync(WebSocketCloseStatus.NormalClosure, String.Empty, _cts.Token).ConfigureAwait(false); CancelListener(); OnDisconnected(); }