Beispiel #1
0
        private void reciveDataDeal(byte[] buf, int length, string ipClient) //处理一下,接收数据之后,缓存一下隔一段时间处理
        {
            Array.Copy(buf, 0, buffer, index_re, length);
            index_re += length;

            UDPDATA_IP udpData = new UDPDATA_IP();

            udpData.Length = length;
            udpData.Ip     = ipClient;
            UDPDATA_IPs.Add(udpData);
            if (timeReve + 500 < XwDataUtils.GetLongTimeStamp() || index_re > buffer.Length)
            {
                ThreadPool.QueueUserWorkItem(new WaitCallback(dealDataThread), UDPDATA_IPs.ToList()); //参数可选
                timeReve = XwDataUtils.GetLongTimeStamp();
            }
        }