首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

一个不存在的历程占用着端口,⊙﹏⊙b

2013-10-01 
一个不存在的进程占用着端口,⊙﹏⊙b一个网络服务端程序,一直运作良好。忽然这一次,在bind的时候发现端口被占

一个不存在的进程占用着端口,⊙﹏⊙b
一个网络服务端程序,一直运作良好。
忽然这一次,在bind的时候发现端口被占用了!
赶紧查:netstat -ano | findstr "12345"
显示:UDP    0.0.0.0:12345      *:*      4868
马上打开任务管理器,看看谁是真凶!
**!竟然找不到任何一个进程的进程ID是4868!
凶手是通过什么方式躲起来的呢?
TCP和UDP都试过这样的情况!
求破此案!谢谢!
[解决办法]
这里有篇帖子,认为结束子进程后,端口就能被释放了。你需要仔细确认下 到底有没有启动子进程,子进程是否都被结束了。

http://serverfault.com/questions/181015/how-do-you-free-up-a-port-being-held-open-by-dead-process

"Normally the OS cleans up these sorts of things, but only when the process record goes away. While the process may not appear to be running any more, there is at least one thing that can keep a record of it around, in order to prevent reuse of its PID. This is the existence of a child process that is not detached from the parent."
对此答案的回复是:"Thanks for your hint!! Killing orphand process really solved the problem. "

[解决办法]
查看相关子进程等,或者结束掉可疑进程
还可以换一个不那么有规律的端口号

热点排行