System.Net.HttpListener.Close C# (CSharp) Method

Close() public method

public Close ( ) : void
return void
        public void Close()
        {
            if (NetEventSource.IsEnabled) NetEventSource.Enter(this, nameof(Close));
            try
            {
                if (NetEventSource.IsEnabled) NetEventSource.Info("HttpListenerRequest::Close()");
                ((IDisposable)this).Dispose();
            }
            catch (Exception exception)
            {
                if (NetEventSource.IsEnabled) NetEventSource.Error(this, $"Close {exception}");
                throw;
            }
            finally
            {
                if (NetEventSource.IsEnabled) NetEventSource.Exit(this);
            }
        }

Usage Example

		public void Disposed5 ()
		{
			HttpListener listener = new HttpListener ();
			HLPC coll = listener.Prefixes;
			listener.Close ();
			string [] strs = new string [0];
			coll.CopyTo (strs, 0);
		}
All Usage Examples Of System.Net.HttpListener::Close