博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
WCF开发常见问题:“There is already a listener on IP endpoint 0.0.0.0:4503”
阅读量:6977 次
发布时间:2019-06-27

本文共 1400 字,大约阅读时间需要 4 分钟。

在寄宿到控制台的WCF服务启动时或者运行期间,经常自己停掉,通过日志记录可以看到

2010/10/27 10:19:08 : There is already a listener on IP endpoint 0.0.0.0:4503.  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.

应该是同一个端口被多个服务监听了,查了一下服务的配置,果然如此

 

代码
<
service 
behaviorConfiguration
="WCFService.Behavior"
 name
="WCFService.SynchronizationService"
>
 
        
<
host
>
 
          
<
baseAddresses
>
 
            
<
add 
baseAddress
="net.tcp://localhost:4503/SynchronizationService"
/>
 
          
</
baseAddresses
>
 
        
</
host
>
 
        
<
endpoint 
address
=""
 binding
="netTcpBinding"
 contract
="WCFService.ISynchronizationService"
 bindingConfiguration
="netTcpBindConfig"
></
endpoint
>
 
        
<
endpoint 
address
="mex"
 binding
="mexTcpBinding"
 contract
="IMetadataExchange"
 
></
endpoint
>
 
      
</
service
>
      
<
service 
behaviorConfiguration
="WCFService.Behavior"
 name
="AuthenticateService"
>
 
        
<
host
>
 
          
<
baseAddresses
>
 
            
<
add 
baseAddress
="net.tcp://localhost:4503/AuthenticateService"
/>
 
          
</
baseAddresses
>
 
        
</
host
>
 
        
<
endpoint 
address
=""
 binding
="netTcpBinding"
 contract
="IAuthenticateService"
 bindingConfiguration
="netTcpBindConfig"
></
endpoint
>
 
        
<
endpoint 
address
="mex"
 binding
="mexTcpBinding"
 contract
="IMetadataExchange"
 
></
endpoint
>
 
      
</
service
>

 

于是将其中一个服务的端口改掉成4504即可。

为了保证端口的唯一性,首先这个端口不能是常见的系统端口,其次不能是其他服务所用的端口。

 

     本文转自wengyuli 51CTO博客,原文链接:http://blog.51cto.com/wengyuli/586702,如需转载请自行联系原作者

你可能感兴趣的文章
用mpvue实现的微信小程序版cnode社区
查看>>
react es6+ 代码优化之路-1
查看>>
《深入java虚拟机》读书笔记类加载
查看>>
深入浅出JVM的锁优化案例
查看>>
LSTM神经网络
查看>>
Litmus代码质量平台实践总结
查看>>
[译] Don’t call me, I’ll call you:使用 Redux-Saga 管理 React 应用中的异步 action (上)...
查看>>
React Native开源项目如何运行(附一波开源项目)
查看>>
js 创建一条通用链表
查看>>
Webpack 核心开发者 Sean Larkin 盛赞 Vue
查看>>
七牛云内容审核服务被选为「上海首批人工智能创新产品」
查看>>
总结PHP 7新增加的特性
查看>>
【刷算法】LeetCode- 两数之和
查看>>
与HTTP关系密切的协议:IP、TCP、DNS
查看>>
pwa+webpack,初探与踩坑
查看>>
x-http-wrapper: 如何解决每次发版时,修改http相关代码造成的错误!(Android、iOS、h5)...
查看>>
java/android 设计模式学习笔记(1)--- 单例模式
查看>>
Python 代码规范
查看>>
Python 之 pip拒绝访问
查看>>
cglib代理的使用
查看>>