Class NtpServer
Provides a very simple NTP (Network Time Protocol) server implementation that responds to time synchronization requests. Should be used on LAN in offline environments.
public class NtpServer : IDisposable
- Inheritance
-
NtpServer
- Implements
- Inherited Members
Constructors
NtpServer()
Initializes a new instance of the NtpServer class with a default socket transport.
public NtpServer()
NtpServer(INetworkTransport)
Initializes a new instance of the NtpServer class with the specified network transport.
public NtpServer(INetworkTransport transport)
Parameters
transportINetworkTransportThe network transport to use, or
nullto create a default socket transport.
Properties
EndPoints
Gets the list of endpoints the server listens on.
public List<IPEndPoint> EndPoints { get; }
Property Value
Remarks
The default endpoint is Any on port 123 (the standard NTP port). Modify this list before calling Start() to change the listening endpoints.
Methods
Dispose()
Releases all resources used by this NTP server.
public void Dispose()
Start()
Starts the NTP server and begins listening for time synchronization requests.
public void Start()
Stop()
Stops the NTP server and releases associated resources.
public void Stop()