* .hgignore: Ignoring class files.
[cacao.git] / tests / network / DemoClient.java
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 }