public void Connect() { if (_socket == null) { _socket = CreateSocket(WebSocketUri); AttachEvents(); } Task.Run(ConnectAndStartListening).ConfigureAwait(false); }
/// <inheritdoc cref="ITransport" /> public void Connect() { if (_socket == null) { _socket = CreateSocket(WebSocketUri); AttachEvents(); } StartReaderBackgroundThread(); }
private void DisposeSocketConnection() { DetachEvents(); try { _socket?.Dispose(); } catch (Exception e) { Logger.Warning("Error while disposing socket. Nothing to worry about. Message: " + e.Message); } finally { _socket = null; } }