WebSocketSharp.Net.ListenerAsyncResult.Complete C# (CSharp) Method

Complete() private method

private Complete ( Exception exception ) : void
exception System.Exception
return void
        internal void Complete(Exception exception)
        {
            _exception = InGet && (exception is ObjectDisposedException)
                 ? new HttpListenerException (500, "Listener closed")
                 : exception;

              lock (_sync) {
            _completed = true;
            if (_waitHandle != null)
              _waitHandle.Set ();

            if (_callback != null)
              ThreadPool.QueueUserWorkItem (invokeCallback, this);
              }
        }

Same methods

ListenerAsyncResult::Complete ( WebSocketSharp.Net.HttpListenerContext context ) : void
ListenerAsyncResult::Complete ( WebSocketSharp.Net.HttpListenerContext context, bool syncCompleted ) : void

Usage Example

        internal void Complete(Exception exc)
        {
            if (forward != null)
            {
                forward.Complete(exc);
                return;
            }

            exception = exc;
            if (InGet && (exc is ObjectDisposedException))
            {
                exception = new HttpListenerException(500, "Listener closed");
            }

            lock (locker) {
                completed = true;
                if (handle != null)
                {
                    handle.Set();
                }

                if (cb != null)
                {
                    ThreadPool.UnsafeQueueUserWorkItem(InvokeCB, this);
                }
            }
        }
All Usage Examples Of WebSocketSharp.Net.ListenerAsyncResult::Complete