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 / DemoClient.java next >
Text File  |  1996-09-28  |  568b  |  29 lines

  1. import java.net.*;
  2. import java.io.*;
  3.  
  4. public class DemoClient extends Thread
  5. {
  6.     public static void main(String[] args)
  7.     {
  8.         DemoClient app = new DemoClient();
  9.         app.start();
  10.     }
  11.  
  12.     public void run()
  13.     {
  14.         Socket newSocket;
  15.  
  16.         try {
  17.             newSocket = new Socket("localhost", 5758);
  18.             System.out.println("Client connected to server.");
  19.             DataOutputStream outStream = new DataOutputStream(
  20.                 newSocket.getOutputStream());
  21.             outStream.writeInt(12345);
  22.             System.exit(0);
  23.         } catch (Exception oops) {
  24.             System.out.println("Error connecting to server");
  25.             return;
  26.         }
  27.     }
  28. }
  29.