Exemplo n.º 1
0
        public string GetAllCacheCmdPacketInfo()
        {
            int nTotal  = 0;
            int nMaxNum = 0;

            lock (this.dictInPackets)
            {
                for (int i = 0; i < this.dictInPackets.Values.Count; i++)
                {
                    TCPInPacket tcpInPacket = this.dictInPackets.Values.ElementAt(i);
                    if (tcpInPacket.GetCacheCmdPacketCount() > nMaxNum)
                    {
                        nMaxNum = tcpInPacket.GetCacheCmdPacketCount();
                    }
                    nTotal += tcpInPacket.GetCacheCmdPacketCount();
                }
            }
            return(string.Format("总共缓存命令包{0}个,单个连接最大缓存{1}个", nTotal, nMaxNum));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 返回待处理数据包信息 用于界面显示用
        /// </summary>
        /// <returns></returns>
        public String GetAllCacheCmdPacketInfo()
        {
            int nTotal  = 0;
            int nMaxNum = 0;

            lock (dictInPackets) //锁定接收包队列
            {
                for (int n = 0; n < dictInPackets.Values.Count; n++)
                {
                    TCPInPacket tcpInPacket = dictInPackets.Values.ElementAt(n);

                    if (tcpInPacket.GetCacheCmdPacketCount() > nMaxNum)
                    {
                        nMaxNum = tcpInPacket.GetCacheCmdPacketCount();
                    }

                    nTotal += tcpInPacket.GetCacheCmdPacketCount();
                }
            }

            /**/ return(String.Format("总共缓存命令包{0}个,单个连接最大缓存{1}个", nTotal, nMaxNum));
        }