/// <summary> /// Stops receiving incoming requests. /// </summary> /// <exception cref="ObjectDisposedException"> /// This listener has been closed. /// </exception> public void Stop() { CheckDisposed(); if (!_listening) { return; } lock (_contextRegistrySync) { if (!_listening) { return; } _listening = false; cleanupContextQueue(false); cleanupContextRegistry(); var msg = "The listener is stopped."; var ex = new HttpListenerException(995, msg); cleanupWaitQueue(ex); EndPointManager.RemoveListener(this); } }
/// <summary> /// Stops receiving incoming requests. /// </summary> /// <exception cref="ObjectDisposedException"> /// This listener has been closed. /// </exception> public void Stop() { if (_disposed) { throw new ObjectDisposedException(_objectName); } lock (_contextRegistrySync) { if (_disposed) { throw new ObjectDisposedException(_objectName); } if (!_listening) { return; } _listening = false; cleanupContextQueue(false); cleanupContextRegistry(); var msg = "The listener is stopped."; cleanupWaitQueue(msg); EndPointManager.RemoveListener(this); } }
/// <summary> /// Removes all URI prefixes from the collection. /// </summary> /// <exception cref="ObjectDisposedException"> /// The <see cref="HttpListener"/> associated with this collection is closed. /// </exception> public void Clear() { _listener.CheckDisposed(); _prefixes.Clear(); if (_listener.IsListening) { EndPointManager.RemoveListener(_listener); } }
public void Stop() { CheckDisposed(); if (_listening) { _listening = false; EndPointManager.RemoveListener(this); sendServiceUnavailable(); } }
public void Stop() { this.CheckDisposed(); if (!this._listening) { return; } this._listening = false; EndPointManager.RemoveListener(this); this.sendServiceUnavailable(); }
/// <summary> /// Removes all URI prefixes from the collection. /// </summary> /// <exception cref="ObjectDisposedException"> /// The <see cref="HttpListener"/> instance associated with this /// collection is closed. /// </exception> public void Clear() { if (_listener.IsDisposed) { throw new ObjectDisposedException(_listener.GetType().ToString()); } if (_listener.IsListening) { EndPointManager.RemoveListener(_listener); } _prefixes.Clear(); }
private void close(bool force) { EndPointManager.RemoveListener(this); lock (_ctxRegistrySync) { if (!force) { sendServiceUnavailable(); } } cleanupContextRegistry(); cleanupConnections(); cleanupWaitQueue(new ObjectDisposedException(GetType().ToString())); }
public void Stop() { this.CheckDisposed(); if (this._listening) { this._listening = false; EndPointManager.RemoveListener(this); lock (this._ctxRegistrySync) { this.cleanupContextQueue(true); } this.cleanupContextRegistry(); this.cleanupConnections(); this.cleanupWaitQueue(new HttpListenerException(0x3e3, "The listener is stopped.")); } }
private void close(bool force) { if (this._listening) { this._listening = false; EndPointManager.RemoveListener(this); } lock (this._ctxRegistrySync) { this.cleanupContextQueue(!force); } this.cleanupContextRegistry(); this.cleanupConnections(); this.cleanupWaitQueue(new ObjectDisposedException(base.GetType().ToString())); this._disposed = true; }
/// <summary> /// Stops receiving incoming requests. /// </summary> /// <exception cref="ObjectDisposedException"> /// This listener has been closed. /// </exception> public void Stop() { CheckDisposed(); if (!_listening) { return; } _listening = false; EndPointManager.RemoveListener(this); lock (_ctxRegistrySync) cleanupContextQueue(true); cleanupContextRegistry(); cleanupConnections(); cleanupWaitQueue(new HttpListenerException(995, "The listener is stopped.")); }
private void close(bool force) { if (_listening) { _listening = false; cleanupContextQueue(force); cleanupContextRegistry(); var name = GetType().ToString(); var ex = new ObjectDisposedException(name); cleanupWaitQueue(ex); EndPointManager.RemoveListener(this); } _disposed = true; }
private void close(bool force) { if (!_listening) { _disposed = true; return; } _listening = false; cleanupContextQueue(force); cleanupContextRegistry(); var msg = "The listener is closed."; cleanupWaitQueue(msg); EndPointManager.RemoveListener(this); _disposed = true; }
private void close(bool force) { if (!_listening) { _disposed = true; return; } _listening = false; cleanupContextQueue(force); cleanupContextRegistry(); var ex = new ObjectDisposedException(_objectName); cleanupWaitQueue(ex); EndPointManager.RemoveListener(this); _disposed = true; }
public void Stop() { this.CheckDisposed(); if (this._listening) { this._listening = false; EndPointManager.RemoveListener(this); object obj = this._ctxRegistrySync; Monitor.Enter(obj); try { this.cleanupContextQueue(true); } finally { Monitor.Exit(obj); } this.cleanupContextRegistry(); this.cleanupConnections(); this.cleanupWaitQueue(new HttpListenerException(995, "The listener is stopped.")); } }
private void close(bool force) { EndPointManager.RemoveListener(this); cleanup(force); }
void Close(bool force) { EndPointManager.RemoveListener(this); Cleanup(force); }
void Close(bool force) { CheckDisposed(); EndPointManager.RemoveListener(this); Cleanup(force); }