FileDocCategorySizeDatePackage
UDPPortScanner.javaAPI DocExample526Sat Sep 09 20:51:56 BST 2000None

UDPPortScanner

public class UDPPortScanner extends Object

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

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