Package examples.ntp
Class NTPClient
java.lang.Object
examples.ntp.NTPClient
This is an example program demonstrating how to use the NTPUDPClient
class. This program sends a Datagram client request packet to a
Network time Protocol (NTP) service port on a specified server,
retrieves the time, and prints it to standard output along with
the fields from the NTP message header (e.g. stratum level, reference id,
poll interval, root delay, mode, ...)
See the spec
for details.
Usage: NTPClient <hostname-or-address-list>
Example: NTPClient clock.psu.edu
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidprocessResponse(TimeInfo info) ProcessTimeInfoobject and print its details.
-
Constructor Details
-
NTPClient
public NTPClient()
-
-
Method Details
-
processResponse
ProcessTimeInfoobject and print its details.- Parameters:
info-TimeInfoobject.
-
main
-