예제 #1
0
        public void Shutdown()
        {
            if (m_LRUDetect != null)
            {
                m_LRUDetect.Dispose();
            }

            if (m_ReceiveWorkers != null)
            {
                m_ReceiveWorkers.ForEach(x => x.WaitShutdown());
                m_ReceiveWorkers.Clear();
            }

            if (m_SendWorkers != null)
            {
                m_SendWorkers.ForEach(x => x.WaitShutdown());
                m_SendWorkers.Clear();
            }

            if (m_DataWorkers != null)
            {
                m_DataWorkers.ForEach(x => x.WaitShutdown());
                m_DataWorkers.Clear();
            }

            SaeaManager.Dispose();
            Logger.LogDebug("socketruntime shutdown.");
        }
예제 #2
0
        public SocketRuntime InitialPool(int bufferSize = 4096, int initialCount = 20000)
        {
            if (m_SaeaManager != null)
            {
                throw new Exception("this initial complete.");
            }

            BufferSize    = bufferSize;
            m_SaeaManager = new SaeaManager();
            m_SaeaManager.Initial(bufferSize, initialCount);
            Logger.LogDebug("initial pool buffsize:{0} initialcount:{1}.", bufferSize, initialCount);
            return(this);
        }