开发者

Detecting whether any socket is connected with any url in system in Java

I want to detect whether socket connection with a particular ip address is already established in the system. In Linux there are 4 desktops so if tcp socket connection is already established in 2nd des开发者_C百科ktop and I want to re-establish in third desktop or if I want to re-establish another connection using another user with the same ip address then I should receive an error message.

How can I get this functionality through my java program?


You could run netstat -a and parse the output.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜