不确认,也许异常关闭的时候没有到close这里。
但是 程序的进程都不在了啊,也没有子进程。
7460这个PID在任务管理器中也没有[/quote]
Windows的句柄管理不会这么糟糕吧?
这里有篇帖子,认为结束子进程后,端口就能被释放了。你需要仔细确认下 到底有没有启动子进程,子进程是否都被结束了。
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. "