Is there a way to programmatically find out if a port number is in use?

yathusree thirumalai

You can do the following:

try {
    ServerSocket s = new ServerSocket(portno);
}
catch(IOException e) {
    System.out.println("port " + portno + " already in use");
}
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact