|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mindprod.setclock.MiniSNTP
public final class MiniSNTP
handles SNTP Simple Network Time Protocol to ask the time of an atomic clock.
see RFC 1769 for a full description of the datagram. The packet is written in big-endian binary format. Timestamps in the packets are in scaled unsigned seconds since Jan 1, 1900 0:00, with 32 bits of integer and 32 bit of binary fracion. set PC Clock from an atomic clock.
Method Summary | |
---|---|
static long |
correction(java.lang.String ntpServer)
Calculate how far out local time is from what server says: Positive result means local clock is running, slow, it requires a number added to it to give the correct time. |
protected void |
dump()
debugging dump of state variables |
static void |
main(java.lang.String[] args)
test harness |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static long correction(java.lang.String ntpServer)
ntpServer
- domain or IP of ntp server no http:// on ntp:// on front.
protected void dump()
public static void main(java.lang.String[] args)
args
- not used
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |