This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes check if a UDP port is busy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "check if a UDP port is busy" Watch "check if a UDP port is busy" New topic
Author

check if a UDP port is busy

Deepak Saini
Greenhorn

Joined: Mar 06, 2003
Posts: 11
Hi,
before i create a socket at a udp port, i need to check if it is already in use. Any idea how to do it..
Mallick Choppa
Greenhorn

Joined: May 23, 2003
Posts: 9
Hi,
Java doesn't provide that type of API (Correct me if I am Wrong). But i would say try to open the datagram Socket within a Try Catch block and catch for Bind exception then you can implement what ever is your requirement.
hope this helps
Mallick
mallick@orillion.stph.net
Mallick Choppa
Greenhorn

Joined: May 23, 2003
Posts: 9
Hi,
JDK1.4 provids an API to check whether the socket is bound or not.
I didn't use this but it may be worth checking it.
Mallick
mallick@orillion.stph.net
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: check if a UDP port is busy
 
Similar Threads
Small trouble with Eclipse
How to find out if address is in use
JBoss 405 Clustering
problem in running Jboss and tomcat server in Eclipse SDK
No buffer space available problem