开发者

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

开发者 https://www.devze.com 2022-12-21 05:09 出处:网络
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 de

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

精彩评论

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