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

饿半肚 2013-09-30 12:30:33
一个网络服务端程序,一直运作良好。
忽然这一次,在bind的时候发现端口被占用了!
赶紧查:netstat -ano | findstr "12345"
显示:UDP 0.0.0.0:12345 *:* 4868
马上打开任务管理器,看看谁是真凶!
**!竟然找不到任何一个进程的进程ID是4868!
凶手是通过什么方式躲起来的呢?
TCP和UDP都试过这样的情况!
求破此案!谢谢!
...全文
297 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
davidyu720 2013-09-30
  • 打赏
  • 举报
回复
参考 http://bbs.csdn.net/topics/390525123
davidyu720 2013-09-30
  • 打赏
  • 举报
回复
这里有篇帖子,认为结束子进程后,端口就能被释放了。你需要仔细确认下 到底有没有启动子进程,子进程是否都被结束了。 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. "
饿半肚 2013-09-30
  • 打赏
  • 举报
回复
谢谢两位哦!果然子进程就是真凶。。虽然这个子进程和这个UDP的端口绑定貌似不存在任何关系。。 哈哈,这个12345是随便写的。
oyljerry 2013-09-30
  • 打赏
  • 举报
回复
查看相关子进程等,或者结束掉可疑进程 还可以换一个不那么有规律的端口号

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧