Source Code : Scan your computer for ports in use

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Scan your computer for ports in use

Scan your computer for ports in use
     
import java.net.ServerSocket;

public class LocalScan {
  public static void main(String[] args) {
    for (int i = 1; i < 1023; i++) {
      testPort(i);
    }
    System.out.println("Completed");
  }

  private static void testPort(int i) {
    try {
      ServerSocket sock = new ServerSocket(i);
    } catch (java.io.IOException e) {
      System.out.println("Port " + i + " in use.");
    }
  }
}
           
         
    
    
    
    
  

Thank with us