WCF分布式开发常见错误(11):There is already a listener on IP endpoint ,IP 终结点 已经存在侦听器,

Posted on 2009-05-16 14:51 Frank Xu Lei 阅读(538) 评论(8)   编辑 收藏 网摘 所属分类: WCF分布式开发常见错误

   进行WCF服务终结点配置的过程中,当你配置服务终结点端口,启动服务程序的时候会遇到如下错误,服务无法启动,1.错误信息如下:

  IP终结点(端口) 0.0.0.0:8002已经存在一个侦听器,请确保程序中没有多次使用一个终结点,或别的程序没有监听此终结点(端口)

There is already a listener on IP endpoint 0.0.0.0:8002.  Make sure that you are not trying to use this endpoint multiple times in your application and that there are no other applications listening on this endpoint.

  

   2.原因:此端口已经被使用,即已经有程序在使用一个相同的端口所致。必须我们配置两个服务终结点使用一个终结点端口

< endpoint 
          address
= " http://localhost:8002/WCFService "  
          binding
= " wsHttpBinding "  
          contract
= " WCFService.IWCFService " >
        
</ endpoint >
        
< endpoint 
          address
= " net.tcp://localhost:8002/WCFService "  
          binding
= " netTcpBinding "   bindingName = " netTcpBinding "
          
          contract
= " WCFService.IWCFService " >
        
</ endpoint >

    运行服务程序就会出现错误。

3.解决办法:

 (1)检查机器的端口,确保此端口不是系统服务端口,或者没被其他程序使用。

(2)检查服务终结点配置信息,确保两个不同的服务使用不同的终结点端口

 此例中的修改代码改为端口8001即可:

         < endpoint 
          address
= " http://localhost:8001/WCFService "  
          binding
= " wsHttpBinding "  
          contract
= " WCFService.IWCFService " >
        
</ endpoint >


老徐的博客

【作者】:Frank Xu Lei

【地址】:http://www.cnblogs.com/frank_xl/archive/2009/05/16/1458292.html

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值