import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.util.Locale;
public class DateClient {
final static int PORT = 5000;
public static void main(String[] args) {
try {
Socket s = new Socket("localhost", PORT);
ObjectOutputStream oos;
oos = new ObjectOutputStream(s.getOutputStream());
oos.writeObject(Locale.getDefault());
InputStreamReader isr;
isr = new InputStreamReader(s.getInputStream());
BufferedReader br = new BufferedReader(isr);
System.out.println(br.readLine());
} catch (Exception e) {
System.err.println(e);
}
}
}
|