Indy 9
|
TIdSNTP = class(TIdUDPClient)
SNTP is an extremely reliable protocol for time-synchronization on the Internet with accuracy from 1 to 50 milliseconds, even over great distances.
SNTP Version 4 includes certain optional extensions to the basic Version 3 model. TIdSNTP does not implement the optional extensions for either Key Identifier or Message Digest portions of the NTP/SNTP message format.
TIdSNTP, a descendant of TIdUDPClient, utilizes SNTP in the unicast client mode.
property AdjustmentTime: TDateTime;
AdjustmentTime is calculated according to the algorithm in RFC 2030.
property CheckStratum: Boolean;
property DateTime: TDateTime;
The value in DateTime is read using the protected function GetDateTime. GetDateTime creates an TNTPGram datagram , transmits the datagram as a string containing the unicast SNTP request using Send, and retrieves the response using ReceiveString. If the response is not an empty string, TIdSNTP properties are updated with values in the response.
The value in DateTime can be 0.0 when the NTP datagram response is either an empty string or ignored based on values in LeapIndicator, Stratum, or TransmitTimestamp fields of the response TNTPGram.
Reading the value of DateTime does not affect the clock on the local computer. Use SyncTime to read the value in DateTime prior to updating the clock on the local computer.
property RoundTripDelay: TDateTime;
RoundTripDelay is calculated according to the algorithm in RFC 2030.
constructor Create(AOwner: TComponent); override;
function SyncTime: Boolean;