示例#1
0
        /// <summary>
                  ///  检查发送池包是否超时,若超时则释放资源
                  /// </summary>
        private void CheckTimesOut()
        {
            foreach (int iItemKey in m_listOutDataPools.Keys)
            {
                DataPools stValue = m_listOutDataPools[iItemKey];
                stValue.LeftTime -= m_iWait;

                if (stValue.LeftTime <= 0)
                {
                    m_listOutDataPools.Remove(iItemKey);
                }
            }
        }
示例#2
0
        /// <summary>
                  ///  检查接收池包否完整,若超时则释放资源
                  /// </summary>
        private void CheckTimesIn()
        {
            foreach (int iItemKey in m_listInDataPools.Keys)
            {
                DataPools stValue = m_listInDataPools[iItemKey];
                stValue.LeftTime -= m_iWait;

                if (stValue.LeftTime <= 0)
                {
                    RemoveByKey(iItemKey);
                }
                else if (stValue.LeftTime <= 27000)
                {
                    if (stValue.ExistPack < stValue.TotalPack)
                    {
                        List <ResendInfo> listResendInfos = FindLostPack(iItemKey, m_listInDataPools[iItemKey].EndPoint);

                        // 请求重发
                        Resend(listResendInfos);
                    }
                }
            }
        }