public async Task <bool> Disconnect() { try { await Client.Stop(WebSocketCloseStatus.Empty, string.Empty); PubSubPingTimer.Dispose(); Client.Dispose(); return(true); } catch { return(false); } }
/// <inheritdoc/> public Task StopAsync(CancellationToken cancellationToken) { return(_client?.Stop(System.Net.WebSockets.WebSocketCloseStatus.NormalClosure, "WebsocketService stopped.")); }