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

查看:225
本文介绍了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.

但互联网上有很多地方(比如这个这个)说只有一个进程可以同时监听每个端口。

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

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

IP Listen List允许WCF服务与为机器的某些IP地址使用端口的应用程序共存。如果IP Listen List包含任何条目,则HTTP Server 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天全站免登陆