コード例 #1
0
 public NtpSyncModule(string ntpServer)
 {
     _ntpEndPoint = new NetEndPoint(ntpServer, 123);
     _socket      = new NetSocket(OnMessageReceived);
     _socket.Bind(0, false);
     SyncedTime = null;
 }
コード例 #2
0
ファイル: NetManager.cs プロジェクト: Gazoon007/TBS-Project
        /// <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);
        }