Пример #1
0
        public void Refresh()
        {
            if (SetThread != null)
            {
                OnDestroy();
            }

            SetQueue = new Queue();
            LateTime = DateTime.Now;//刷新心跳时间

            udpSet         = new UdpClient();
            SetServerPoint = new IPEndPoint(IPAddress.Parse(SetIP), SetPORT);//发送服务器端口IP

            //=[线程启动]======
            SetThread = new SD_Thread(DataQueueProcessor);
            SetThread.Start();
        }
Пример #2
0
        public void Refresh()
        {
            if (GetThread != null)
            {
                OnDestroy();
            }

            GetQueue = new Queue();
            LateTime = DateTime.Now;//刷新心跳时间

            IPAddress ServerIp = Dns.GetHostEntry(Dns.GetHostName()).AddressList[2];

            Local_IP = ServerIp.ToString(); //获取本地IP


            udpGet         = new UdpClient(new IPEndPoint(IPAddress.Parse(Local_IP), Local_PORT)); //绑定IP和端口
            GetServerPoint = new IPEndPoint(IPAddress.Any, 0);                                     //监听接收的所有消息

            //=[线程启动]======
            GetThread   = new SD_Thread(DataQueueProcessor);
            ClockThread = new SD_Thread(ClockCheck);
            GetThread.Start();
            ClockThread.Start();
        }