FileDocCategorySizeDatePackage
LocalPortScanner.javaAPI DocExample527Sat Sep 09 20:50:26 BST 2000None

LocalPortScanner

public class LocalPortScanner extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)

    
    for (int port = 1; port <= 65535; port++) {
      
      try {
        // the next line will fail and drop into the catch block if
        // there is already a server running on the port
        ServerSocket server = new ServerSocket(port);
      }
      catch (IOException e) {
        System.out.println("There is a server on port " + port + ".");
      } // end try
      
    } // end for