private void Initialize() { _acceptSaeaPool = new SaeaPool(16, 32, () => { var saea = new SaeaAwaitable(); return(saea); }, (saea) => { try { saea.Saea.AcceptSocket = null; saea.Saea.SetBuffer(0, 0); saea.Saea.RemoteEndPoint = null; saea.Saea.SocketFlags = SocketFlags.None; } catch (Exception ex) { _log.Error(ex.Message, ex); } }); _handleSaeaPool = new SaeaPool(1024, int.MaxValue, () => { var saea = new SaeaAwaitable(); return(saea); }, (saea) => { try { saea.Saea.AcceptSocket = null; saea.Saea.SetBuffer(EmptyArray, 0, 0); saea.Saea.RemoteEndPoint = null; saea.Saea.SocketFlags = SocketFlags.None; } catch (Exception ex) { _log.Error(ex.Message, ex); } }); _sessionPool = new SessionPool(1024, int.MaxValue, () => { var session = new TcpSocketSaeaSession(_configuration, _configuration.BufferManager, _handleSaeaPool, _dispatcher, this); return(session); }, (session) => { try { session.Clear(); } catch (Exception ex) { _log.Error(ex.Message, ex); } }); }