Class TSNTPSend

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TSNTPSend = class(TSynaClient)

Description

Implementation of NTP and SNTP client protocol

, include time synchronisation. It can send NTP or SNTP time queries, or it can receive NTP broadcasts too.

Note: Are you missing properties for specify server address and port? Look to parent TSynaClient too!

Hierarchy

Overview

Methods

Public constructor Create;
Public destructor Destroy; override;
Public function DecodeTs(Nsec, Nfrac: Longint): TDateTime;
Public procedure EncodeTs(dt: TDateTime; var Nsec, Nfrac: Longint);
Public function GetSNTP: Boolean;
Public function GetNTP: Boolean;
Public function GetBroadcastNTP: Boolean;

Properties

Public property NTPReply: TNtp read FNTPReply;
Published property NTPTime: TDateTime read FNTPTime;
Published property NTPOffset: Double read FNTPOffset;
Published property NTPDelay: Double read FNTPDelay;
Published property MaxSyncDiff: double read FMaxSyncDiff write FMaxSyncDiff;
Published property SyncTime: Boolean read FSyncTime write FSyncTime;
Published property Sock: TUDPBlockSocket read FSock;

Description

Methods

Public constructor Create;
 
Public destructor Destroy; override;
 
Public function DecodeTs(Nsec, Nfrac: Longint): TDateTime;

Decode 128 bit timestamp used in NTP packet to TDateTime type.

Public procedure EncodeTs(dt: TDateTime; var Nsec, Nfrac: Longint);

Decode TDateTime type to 128 bit timestamp used in NTP packet.

Public function GetSNTP: Boolean;

Send request to TSynaClient.TargetHost and wait for reply. If all is OK, then result is True and NTPReply and NTPTime are valid.

Public function GetNTP: Boolean;

Send request to TSynaClient.TargetHost and wait for reply. If all is OK, then result is True and NTPReply and NTPTime are valid. Result time is after all needed corrections.

Public function GetBroadcastNTP: Boolean;

Wait for broadcast NTP packet. If all OK, result is True and NTPReply and NTPTime are valid.

Properties

Public property NTPReply: TNtp read FNTPReply;

Holds last received NTP packet.

Published property NTPTime: TDateTime read FNTPTime;

Date and time of remote NTP or SNTP server. (UTC time!!!)

Published property NTPOffset: Double read FNTPOffset;

Offset between your computer and remote NTP or SNTP server.

Published property NTPDelay: Double read FNTPDelay;

Delay between your computer and remote NTP or SNTP server.

Published property MaxSyncDiff: double read FMaxSyncDiff write FMaxSyncDiff;

Define allowed maximum difference between your time and remote time for synchronising time. If difference is bigger, your system time is not changed!

Published property SyncTime: Boolean read FSyncTime write FSyncTime;

If True, after successfull getting time is local computer clock synchronised to given time. For synchronising time you must have proper rights! (Usually Administrator)

Published property Sock: TUDPBlockSocket read FSock;

Socket object used for TCP/IP operation. Good for seting OnStatus hook, etc.


Generated by PasDoc 0.9.0 on 2012-04-23 21:38:51