public override void Abort() { if ((InternalState)_state == InternalState.Disposed) { return; } if (WebSocketHandle.IsValid(_innerWebSocket)) { _innerWebSocket.Abort(); } Dispose(); }
public override void Dispose() { var priorState = (InternalState)Interlocked.Exchange(ref _state, (int)InternalState.Disposed); if (priorState == InternalState.Disposed) { // No cleanup required. return; } if (WebSocketHandle.IsValid(_innerWebSocket)) { _innerWebSocket.Dispose(); } }