home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / kaffe-0.5p4-src.tgz / tar.out / contrib / kaffe / test / network / socktest.java < prev    next >
Text File  |  1996-09-28  |  736b  |  21 lines

  1. import java.lang.*;
  2. import java.net.*;
  3. import java.io.*;
  4. class socktest {
  5.         public static void main(String argv[]) {
  6.                 try {
  7.                         ServerSocket ss = new ServerSocket(9999);
  8.                         Socket s = new Socket("hamlet", 23);
  9.                         InetAddress a1 = InetAddress.getByName("hamlet");
  10.                         InetAddress a2 = InetAddress.getLocalHost();
  11.  
  12.                         System.out.println(ss);
  13.                         System.out.println(s);
  14.                         System.out.println(a1);
  15.                         System.out.println(a2);
  16.                 } catch (IOException e) {
  17.                         System.out.println("error: "+e);
  18.                 }
  19.         }
  20. }
  21.