Beispiel #1
0
        static void Main(string[] args)
        {
            SntpService service = new SntpService(123);

            service.InterfaceAddress = IPAddress.Parse("192.168.1.217");
            service.Start();

            Console.ReadKey();
            service.Stop();
        }
Beispiel #2
0
        // This service creates a Sntp server that offers time from a relayed server or the local hardware
        public static void Main()
        {
            // Initialize logging
            Logger.Initialize(new DebugLogger(), LoggerLevel.Debug);

            //  Create the Sntp server
            SntpService DnsServer = new SntpService();

            // Enable Sntp server to use local device for it's time reference.
            //DnsServer.UseLocalTimeSource = true;

            // enable Sntp server to relay requests to another Sntp server.
            DnsServer.UseLocalTimeSource = false;
            DnsServer.PrimaryServer      = "0.pool.ntp.org";

            // Sets interface ip address
            DnsServer.InterfaceAddress = IPAddress.GetDefaultLocalAddress();

            // Starts Sntp service
            DnsServer.Start();
        }