|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.time.NtpClient
class NtpClient
NtpClient - an NTP client for Java. This program connects to an NTP server and prints the response to the console. The local clock offset calculation is implemented according to the SNTP algorithm specified in RFC 2030. Note that on windows platforms, the curent time-of-day timestamp is limited to an resolution of 10ms and adversely affects the accuracy of the results.
Constructor Summary | |
---|---|
NtpClient()
|
Method Summary | |
---|---|
static long |
currentTime(String serverName)
Query the given NTP server, returning the current internet time |
static long |
currentTime(String[] serverNames)
Query the ntp servers, returning the current time from first one we find |
static long[] |
currentTimeAndStratum(String[] serverNames,
int perServerTimeout)
Query the ntp servers, returning the current time from first one we find Hack to return time and stratum |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
NtpClient()
Method Detail |
---|
public static long currentTime(String[] serverNames)
IllegalArgumentException
- if none of the servers are reachablepublic static long[] currentTimeAndStratum(String[] serverNames, int perServerTimeout)
IllegalArgumentException
- if none of the servers are reachablepublic static long currentTime(String serverName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |