Пример #1
0
        /// <summary>
        /// 添加到发送队列,以后定时检查,超时重发
        /// </summary>
        /// <param name="block"></param>
        /// <param name="ipEndPoint"></param>
        /// <param name="sendEvent"></param>
        protected void PushSendData(MemBlock block, IPEndPoint ipEndPoint)
        {
            SendData sendData = new SendData();
            sendData.EndPoint = ipEndPoint;
            sendData.EnterTime = Environment.TickCount;
            sendData.Packet = block;
            sendData.UUID = BitConverter.ToInt64(block.GetBytes(), 0);

            PushSend(sendData);
        }
Пример #2
0
        /// <summary>
        /// 添加发送
        /// </summary>
        /// <param name="byData"></param>
        protected void PushSend(SendData sendData)
        {
            lock (mSendLock)
            {
                if (mSendQueue.ContainsKey(sendData.UUID))
                {
                    return;
                }

                mSendQueueKey.Add(sendData.UUID);
                mSendQueue.Add(sendData.UUID, sendData);
            }
        }