java.net implemented.
[cacao.git] / tests / network / socktest.java
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(0);
8                         Socket s = new Socket("quinta", 23);
9                         InetAddress a1 = InetAddress.getByName("quinta");
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 }