dcsimg
Checking if a port is under use.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rami_Abramson
Posted On:   Wednesday, October 16, 2002 06:33 AM

			
Hello,

How is it possible to check if a port XXX is available or being used, without using the 'new ServerSocket(portno)' option ?

Using the above solution may allocate the port - something which is undesired:
try {
ServerSocket s = new ServerSocket(portno);
}
catch(IOException e) {
System.out.println("port " + portno + " already in use");
}


Whould appreciate a quick response.

thank you,

Rami

Re: Checking if a port is under use.

Posted By:   Christopher_Koenigsberg  
Posted On:   Wednesday, October 16, 2002 06:59 AM

You could try connecting to it as a client, instead of binding to it as a server.

About | Sitemap | Contact