예제 #1
0
 /// <summary>
 /// 初始化
 /// </summary>
 internal void Initialize(SocketDispatcherBase socketDispatcher,
                          InternalSendDataEventHandler internalSendDataEventHandler,
                          Func <SocketAsyncEventArgs, bool> saeaCollectEventHandler)
 {
     _keepAlive             = new KeepAlive();
     this._socketDispatcher = socketDispatcher;
     this._sendData         = internalSendDataEventHandler;
     readBuffer.Initialize(saeaCollectEventHandler, this);
     OnInitialized();
 }
예제 #2
0
        public SessionPool(SocketDispatcherBase socketDispatcher,
                           InternalSendDataEventHandler sendData,
                           Func <SocketAsyncEventArgs, bool> saeaCollectEventHandler)
        {
            this._socketDispatcher        = socketDispatcher;
            this._sendData                = sendData;
            this._saeaCollectEventHandler = saeaCollectEventHandler;

            Min = Environment.ProcessorCount;
            if (Min < 2)
            {
                Min = 2;
            }

            Max = int.MaxValue;

            IdleTime = 60;
        }