protected virtual bool EnablePools() { if (!UsePools) { Pool = new Pool <UDPPacketBuffer>(() => new UDPPacketBuffer(), 500); UsePools = true; return(true); } return(false); }
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; }