Java 连接 netstat -ano
我是java新手,我一整天都在测试我的应用程序。
我刚刚做了
netstat-ano
它给了我一个巨大的活动连接列表(正在监听,已建立),这是否意味着当我关闭我的应用程序时,这些连接不会被关闭(close())?
这是屏幕截图:
替代文本 http://img340.imageshack.us/img340/9950 /netor.jpg
关于如何在完成连接后关闭连接有什么建议吗?据我所知,我正在尝试关闭连接,但看来我做得还不够。
感谢您抽出时间。
编辑:tcpview 很棒。是的,这些连接是在代码未完成的当天早些时候进行的。现在,当我运行它时,它会在 tcpview 中注册,并在我关闭连接时消失。
I am new to java and I have been testing my application all day long.
I just did
netstat -ano
and it gave me a huge listing of active connections (listening, established) does this mean when i close my appliation these connections are not being shutdown (close())?
here is a screenshot:
alt text http://img340.imageshack.us/img340/9950/netor.jpg
any advise on how to go about closing the connection when im done with it? i am trying to close the connection best to my knowledge but it appears im not doing enough.
thanks for your time.
EDIT: tcpview is great. yes those connections were earlier on the day when the code was not complete. now when i run it, it gets registered in tcpview and vanishes when i close the connection.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
netstat
只能部分用于此类事情。您的输出不显示哪个进程使用了哪些连接和端口。从微软下载 tcpview 工具,它会清楚地告诉你哪些进程正在使用哪些端口,以及哪个进程正在维护打开的连接。
netstat
is only of partial use for this sort of thing. Your output doesn't show which connections and ports are used by which process.Download the tcpview tool from microsoft, that'll show you clearly which process is using which ports, and which is maintaining open connections.