[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1007
  • Last Modified:

How do I find if a particular port is free on the local machine

I would like to find from a Java program if a particular port of the machine on which the program runs is free. I DO NOT want to bind to that port. I just want to identify if the port is free.
0
jacob_412
Asked:
jacob_412
1 Solution
 
objectsCommented:
don't think it can be done from java . would need native code I'd think

0
 
MicheleMarconCommented:
The only way of knowing it with Java is connecting... but you don't accept this solution.

http://www.cafeaulait.org/course/week12/16.html
0
 
jacob_412Author Commented:
Thanks ! If it is not possible to check if a port is free without connecting, I guess I'll have to accept it an work on this solution.
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now