Why is System.Net.HttpListener creating a new process?

Why HttpListenerdoes the class create a new web server process instead of the usual Socket and HTTP implementation?

+3
source share
2 answers

HttpListener is a wrapper for http.sys ( HTTP Server API ) that is available on Windows XP Service Pack 2 (SP2) or higher. It instructs http.sys to listen for HTTP requests for specific virtual hosts / ports, and when there is a request, it "gives" http.sys response data, which returns it to the client.

The obvious benefits are performance and the ability to share IP addresses and ports with other processes, such as the Internet Information Server (IIS). This means that you can run the virtual host in your process and the virtual host in IIS on the same IP address and port.

+4
source

I have never used this class before, but I assume that the HttpListener actually connects to an existing web server process running in windows? Just a hunch.

+1
source

Source: https://habr.com/ru/post/1720945/


All Articles