List of usage examples for org.apache.commons.net DaytimeTCPClient connect
public void connect(InetAddress host) throws SocketException, IOException
From source file:examples.daytime.java
public static final void daytimeTCP(String host) throws IOException { DaytimeTCPClient client = new DaytimeTCPClient(); // We want to timeout if a response takes longer than 60 seconds client.setDefaultTimeout(60000);// www . j a va 2 s. c o m client.connect(host); System.out.println(client.getTime().trim()); client.disconnect(); }