FileDocCategorySizeDatePackage
RandomPort.javaAPI DocExample334Sun Dec 12 10:53:20 GMT 2004None

RandomPort

public class RandomPort extends Object

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


    try {
      ServerSocket server = new ServerSocket(0);
      System.out.println("This server runs on port " 
       + server.getLocalPort());
    }
    catch (IOException ex) {
      System.err.println(ex);
    }