Esempio n. 1
0
 public NtpSyncModule(string ntpServer)
 {
     _ntpEndPoint = new NetEndPoint(ntpServer, 123);
     _socket      = new NetSocket(OnMessageReceived);
     _socket.Bind(0, false);
     SyncedTime = null;
 }
Esempio n. 2
0
        /// <summary>
        /// Start logic thread and listening on selected port
        /// </summary>
        /// <param name="port">port to listen</param>
        public bool Start(int port)
        {
            if (IsRunning)
            {
                return(false);
            }

            _netEventsQueue.Clear();
            if (!_socket.Bind(port, ReuseAddress))
            {
                return(false);
            }

            _logicThread.Start();
            return(true);
        }