import java.util.List; import java.util.LinkedList; import java.util.Iterator; /** *

// Some replies haven’t shown up yet System.out.println (”Received ” + replies + ” of ” + expect + ” replies”); } } // Print info about a received time reply protected void printTime (long remote1900, InetSocketAddress sa) { // local time as seconds since Jan 1, 1970 long local = System.currentTimeMillis() / 1000; // remote time as seconds since Jan 1, 1970 long remote = remote1900 - DIFF_1900; Date remoteDate = new Date (remote * 1000); Date localDate = new Date (local * 1000); long skew = remote - local; System.out.println (”Reply from ” + sa.getHostName() + “:” + sa.getPort()); System.out.println (” there: ” + remoteDate); System.out.println (” here: ” + localDate); System.out.print (” skew: “); if (skew == 0) { System.out.println (”none”); } else if (skew > 0) { System.out.println (skew + ” seconds ahead”); } else { System.out.println ((-skew) + ” seconds behind”); } } protected void parseArgs (String [] argv) { remoteHosts = new LinkedList(); for (int i = 0; i < argv.length; i++) { String arg = argv [i]; // Send client requests to the given port if (arg.equals ("-p")) { i++; this.port = Integer.parseInt (argv [i]); continue; } // Create an address object for the hostname InetSocketAddress sa = new InetSocketAddress (arg, port); // Validate that it has an address if (sa.getAddress() == null) { System.out.println ("Cannot resolve address: " + arg); continue; } 118

Hint: If you are looking for very good and affordable webspace to host and run your tomcat hosting application check Virtualwebstudio tomcat web hosting provider

Comments are closed.