首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >无法在某个TCP端口上开始侦听,但目前没有监听该端口的任何内容

无法在某个TCP端口上开始侦听,但目前没有监听该端口的任何内容
EN

Server Fault用户
提问于 2011-02-15 10:26:40
回答 1查看 5.6K关注 0票数 3

我的Windows使用WCF服务主机侦听TCP端口61000上的连接。当我尝试启动服务时,我会得到以下错误:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
Service cannot be started. System.ServiceModel.AddressAlreadyInUseException: HTTP could not register URL http://+:61000/ because TCP port 61000 is being used by another application. ---> System.Net.HttpListenerException: The process cannot access the file because it is being used by another process
   at System.Net.HttpListener.AddAll()
   at System.Net.HttpListener.Start()
   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
   --- End of inner exception stack trace ---
   at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen()
   at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
   at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
   at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout)
   at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
   at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
   at...

一个快速的netstat -a显示在端口61000上没有任何监听内容。我还在网上找到了几个提到使用netstat的帖子,但是该服务运行的帐户具有管理员权限,所以这不应该是必要的。

关于我为什么会收到这条信息还有什么其他的想法吗?

此服务运行在64位Windows 2008 R2标准上.

EN

回答 1

Server Fault用户

发布于 2012-06-15 18:37:57

如果程序关闭时端口上有一个打开的连接,而TCP没有完成4路关闭握手,则套接字将保持“半关闭”状态,直到超时结束(即使程序已终止),并将阻止您再次打开该端口。不同的实现有不同的超时,通常从1/2秒到2分钟不等。

票数 2
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/235844

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文