List of usage examples for org.apache.commons.net DaytimeTCPClient getTime
public String getTime() throws 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);//from w w w .j av a2 s . c o m client.connect(host); System.out.println(client.getTime().trim()); client.disconnect(); }
From source file:ProtocolRunner.java
private static void handleTCPDaytime( DaytimeTCPClient client, ProtocolRunner runner) throws IOException { runner.getTCPServerResponse().append(client.getTime() + "\r\n"); }