示例#1
0
 public override void Abort()
 {
     if ((InternalState)_state == InternalState.Disposed)
     {
         return;
     }
     if (WebSocketHandle.IsValid(_innerWebSocket))
     {
         _innerWebSocket.Abort();
     }
     Dispose();
 }
示例#2
0
        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();
            }
        }