public final class TimeClient
{
public static final void timeTCP(String host) throws IOException
{
TimeTCPClient client = new TimeTCPClient();
try {
// We want to timeout if a response takes longer than 60 seconds
client.setDefaultTimeout(60000);
client.connect(host);
System.out.println(client.getDate());
} finally {
client.disconnect();
}
}