public Session(IPacketHandleable packetLogicHandler)
        {
            sendQueue  = new Queue <Packet>();
            bytePacker = new BytePacker();

            this.packetLogicHandler = packetLogicHandler;
        }
Exemplo n.º 2
0
        public void Initialize(IPacketHandleable logicHandler, IUserSessionManageable userManager)
        {
            // TODO :: 서버 config 클래스 구현.
            const int maxConnections = 10000;
            const int bufferSize     = 1024;
            const int preAllocCount  = 2;

            bufferManager = new BufferManager(maxConnections * bufferSize * preAllocCount, bufferSize);
            bufferManager.InitBuffer();

            receiveEventArgsPool = new SocketAsyncEventArgsPool(maxConnections);
            sendEventArgsPool    = new SocketAsyncEventArgsPool(maxConnections);
            MakeEventPools(maxConnections);

            httpNetwork = new HttpNetwork();

            this.userManager  = userManager;
            this.logicHandler = logicHandler;
        }