if( args.length != 1 )
{ System.out.println( "Useage: java GetTime host" );
System.exit(0);
}
String host = args[0];
Socket s = null;
try
{ s = new Socket( host, 13 );
BufferedReader r = new BufferedReader(
new InputStreamReader(
s.getInputStream() ) );
boolean done = false;
while( !done )
{ String st = r.readLine();
if( st != null )
{ System.out.println( st );
}
else
{ done = true;
}
}
}
catch( IOException e )
{ e.printStackTrace();
}