List of usage examples for org.apache.commons.net TimeTCPClient connect
public void connect(InetAddress host) throws SocketException, IOException
From source file:examples.rdate.java
public static final void timeTCP(String host) throws IOException { TimeTCPClient client = new TimeTCPClient(); // We want to timeout if a response takes longer than 60 seconds client.setDefaultTimeout(60000);/*from w w w. ja v a 2s. c o m*/ client.connect(host); System.out.println(client.getDate().toString()); client.disconnect(); }