WCF 服务如何侦听与 IIS 相同的端口? [英] How can a WCF service listen the same port as IIS?

查看:32
本文介绍了WCF 服务如何侦听与 IIS 相同的端口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以运行 Windows 服务托管的 WCF 服务侦听 http://localhost:80/MyService 而 IIS 正在为 http://localhost:80 上的页面提供服务和两个都有效.

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

但互联网上的许多地方(例如thisthis) 说只有一个进程可以同时监听每个端口.

But many places in the internet (like this and this) say that only a single process can listen each port simultaneoulsy.

他们错了吗?

推荐答案

可能是您在 IIS 中托管 WCF 服务.以便 IIS 根据 URL 向 WCF 服务发送请求.

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.

也可能 WCF 服务被设置为进行端口共享,如下所示:http://msdn.microsoft.com/en-us/library/ms734772.aspx

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

好的,我重新阅读了您编辑过的问题,请参阅此答案中的链接:http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8993f7c5-1f78-4156-a131-d9b40af10d9a

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

"IP 侦听列表允许 WCF 服务与使用机器的某些 IP 地址的端口的应用程序共存.如果 IP 侦听列表包含任何条目,则 HTTP 服务器 API 将仅绑定到那些 IP 地址列表指定."

"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."

这篇关于WCF 服务如何侦听与 IIS 相同的端口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆