FileDocCategorySizeDatePackage
whois.javaAPI DocExample755Thu Apr 03 15:23:58 BST 1997None

whois

public class whois extends Object

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


       

    Socket theSocket;
    DataInputStream theWhoisStream;
    PrintStream ps;

    try {
      theSocket = new Socket(hostname, port, true);
      ps = new PrintStream(theSocket.getOutputStream());
      for (int i = 0; i < args.length; i++) ps.print(args[i] + " ");
      ps.print("\r\n");
      theWhoisStream = new DataInputStream(theSocket.getInputStream());
      String s;
      while ((s = theWhoisStream.readLine()) != null) {
        System.out.println(s);
      }
    }
    catch (IOException e) {
      System.err.println(e);
    }