public async Task Dispose() { try { if (_dispose) { return; } _dispose = true; HttpLogger?.Dispose(); await SendText("close"); webSocket?.Dispose(); Thread.Sleep(1000); ReceiveHttpAction(); } catch { //ignore } finally { try { client.Dispose(); } catch { //ignore } } }
public WebSocketClient(Action <string, LogLevel> _receiveAction, HttpLogger _loggerKey) { this.receiveAction = _receiveAction; this.HttpLogger = _loggerKey; client = new WebClientExtended(); }