Examples of TimeTCPClient


Examples of org.apache.commons.net.time.TimeTCPClient

public final class rdate
{

    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);
        client.connect(host);
        System.out.println(client.getDate().toString());
        client.disconnect();
    }
View Full Code Here

Examples of org.apache.commons.net.time.TimeTCPClient

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();
    }
    }
View Full Code Here

Examples of org.apache.commons.net.time.TimeTCPClient

public final class rdate
{

    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);
        client.connect(host);
        System.out.println(client.getDate().toString());
        client.disconnect();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.