FileDocCategorySizeDatePackage
RandomPort.javaAPI DocExample316Sat Sep 09 20:50:28 BST 2000None

RandomPort

public class RandomPort extends Object

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


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