Exemplo n.º 1
0
        protected virtual bool EnablePools()
        {
            if (!UsePools)
            {
                Pool = new Pool <UDPPacketBuffer>(() => new UDPPacketBuffer(), 500);

                UsePools = true;

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        protected virtual bool EnablePools()
        {
            if (!UsePools)
            {
                m_pool = new Pool<UDPPacketBuffer>(() => new UDPPacketBuffer(), 500);

                m_poolCountStat
                    = new Stat(
                        "UDPPacketBufferPoolCount",
                        "Objects within the UDPPacketBuffer pool",
                        "The number of objects currently stored within the UDPPacketBuffer pool",
                        "",
                        "clientstack",
                        "packetpool",
                        StatType.Pull,
                        stat => stat.Value = m_pool.Count,
                        StatVerbosity.Debug);

                StatsManager.RegisterStat(m_poolCountStat);

                UsePools = true;

                return true;
            }

            return false;
        }