/* * DayTimeClient.java * * Created on 13 ??????? 2546, 16:38 ?. */ import java.net.*; import java.io.*; /** * @author sup98 * @version */ public class DayTimeClient{ public static void main(String[] args){ Socket theSocket; DataInputStream theTimeStream; try{ theSocket = new Socket("localhost",5050); theTimeStream = new DataInputStream(theSocket.getInputStream()); String theTime = theTimeStream.readUTF(); System.out.print("It is "+theTime); } catch(UnknownHostException e){ System.err.println(e); } catch(IOException e){ System.err.println(e); } } }