System.Net.EndPointListener.UnbindContext C# (CSharp) Method

UnbindContext() public method

public UnbindContext ( HttpListenerContext context ) : void
context HttpListenerContext
return void
		public void UnbindContext (HttpListenerContext context)
		{
			if (context == null || context.Request == null)
				return;

			HttpListenerRequest req = context.Request;
			ListenerPrefix prefix;
			HttpListener listener = SearchListener (req.UserHostName, req.Url, out prefix);
			if (listener != null)
				listener.UnregisterContext (context);
		}

Usage Example

Example #1
0
        public void Close()
        {
            if (o_stream != null)
            {
                Stream st = o_stream;
                st.Close();
                o_stream = null;
            }

            if (sock != null)
            {
                if (chunked && context.Response.ForceCloseChunked == false)
                {
                    // Don't close. Keep working.
                    chunked_uses++;
                    Init();
                    BeginReadRequest();
                    return;
                }

                Socket s = sock;
                sock = null;
                try {
                    s.Shutdown(SocketShutdown.Both);
                } finally {
                    s.Close();
                }
                if (context_bound)
                {
                    epl.UnbindContext(context);
                }
            }
        }
All Usage Examples Of System.Net.EndPointListener::UnbindContext