title: Sockets: Discover port availability using Java
body: <p>How do I programmatically determine the availability of a port in a given machine using Java?</p>
  
  <p>i.e given a port number, determine whether it is already being used or not?.</p>