Ntp |
public class NtpPacket
The NtpPacket type exposes the following members.
| Name | Description | |
|---|---|---|
| Bytes | Gets RFC4330-encoded SNTP packet. | |
| CorrectionOffset | Gets the offset that should be added to local time to synchronize it with server time. | |
| DestinationTimestamp | Gets or sets the time of reception of response SNTP packet on the client. | |
| LeapIndicator | Gets the leap second indicator. | |
| Mode | Gets or sets SNTP packet mode, i.e. whether this is client or server packet. | |
| OriginTimestamp | Gets or sets the time when the client sent its request. | |
| Poll | Gets server's preferred polling interval. | |
| Precision | Gets the precision of server clock. | |
| ReceiveTimestamp | Gets or sets the time when the request was received by the server. | |
| ReferenceId | Gets the ID of the time source used by the server or Kiss-o'-Death code sent by the server. | |
| ReferenceTimestamp | Gets or sets the time when the server clock was last set or corrected. | |
| RootDelay | Gets the total round-trip delay from the server to the reference clock. | |
| RootDispersion | Gets the estimated error in time reported by the server. | |
| RoundTripTime | Gets the round-trip time to the server. | |
| Stratum | Gets server's distance from the reference clock. | |
| TransmitTimestamp | Gets or sets the time when the packet was sent. | |
| VersionNumber | Gets or sets protocol version number. |
| Name | Description | |
|---|---|---|
| Equals | Determines whether the specified object is equal to the current object. (Inherited from Object) | |
| Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object) | |
| FromServerResponse | Initializes packet from data received from a server. | |
| GetHashCode | Serves as the default hash function. (Inherited from Object) | |
| GetType | Gets the Type of the current instance. (Inherited from Object) | |
| MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object) | |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
| Name | Description | |
|---|---|---|
| MethodInvoke |
Calls the object method by name.
(Defined by ObjectEx) | |
| PropertyGet |
Gets the value of the object property by name.
(Defined by ObjectEx) | |
| PropertyGetT |
Gets the value of the object property by name.
(Defined by ObjectEx) | |
| PropertySet |
Sets the value of the object property by name.
(Defined by ObjectEx) |
Most applications should just use the CorrectionOffset property.
The same data structure represents both request and reply packets. Request and reply differ in which properties are set and to what values.
The only real property is Bytes. All other properties read from and write to the underlying byte array with the exception of DestinationTimestamp, which is not part of the packet on network and it is instead set locally after receiving the packet.
Copied from GuerrillaNtp project with permission from Robert Vazan (@robertvazan) under MIT license, see https://github.com/RevenantX/LiteNetLib/pull/236