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.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论