long time, time2;
long clientTime, clientTime2;
try
{
TimeTCPClient client = new TimeTCPClient();
try
{
// We want to timeout if a response takes longer than 60 seconds
client.setDefaultTimeout(60000);
client.connect(InetAddress.getLocalHost(), _port);
clientTime = client.getDate().getTime();
time = System.currentTimeMillis();
} finally
{
client.disconnect();
}
try
{
// We want to timeout if a response takes longer than 60 seconds
client.setDefaultTimeout(60000);
client.connect(InetAddress.getLocalHost(), _port);
clientTime2 = (client.getTime() - TimeTCPClient.SECONDS_1900_TO_1970)*1000L;
time2 = System.currentTimeMillis();
} finally
{
client.disconnect();
}
} finally
{
closeConnections();