import java.net.*; import java.io.*; public class TimeClient { public static void main(String args[]) throws Exception { String host = args[0]; int port = Integer.parseInt(args[1]); Socket connection = new Socket(host, port); InputStream in = connection.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); String response; while ((response = reader.readLine()) != null) { System.out.println("Server response: " + response); } in.close(); connection.close(); } }