How can a WCF service listen the same port as IIS?

前端 未结 2 845
野性不改
野性不改 2020-12-03 17:52

I could run a Windows Service hosted WCF service listening http://localhost:80/MyService while IIS was serving pages on http://localhost:80 and bot

相关标签:
2条回答
  • 2020-12-03 18:03

    Could it be that you are hosting the WCF service in IIS. So that IIS is sending the request to the WCF service based on the URL.

    Edit: It may be also that the WCF services were setup to do port sharing like this: http://msdn.microsoft.com/en-us/library/ms734772.aspx

    Edit2: Ok, I reread your edited question, see the links in this answer: http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8993f7c5-1f78-4156-a131-d9b40af10d9a

    "The IP Listen List allows WCF services to coexist with applications that use a port for some of the IP addresses of the machine. If the IP Listen List contains any entries, the HTTP Server API will only bind to those IP addresses that the list specifies."

    0 讨论(0)
  • 2020-12-03 18:19

    HTTP.sys makes this possible. From the article:

    ...because WCF and IIS 6.0 both use the kernel-mode HTTP stack (HTTP.sys), IIS 6.0 can share port 80 with other self-hosted WCF services running on the same machine...

    HTTP.sys acts as a port-forwarding service, for HTTP (port 80) traffic.

    0 讨论(0)
提交回复
热议问题