Exemplo n.º 1
0
 public void initialize(int capacity)
 {
     capacity            = Math.Max(capacity, 250);
     this.socketListener = new SocketListener(capacity, 32768);
     this.socketListener.SocketClosed    += this.SocketClosed;
     this.socketListener.SocketConnected += this.SocketConnected;
     this.socketListener.SocketReceived  += this.SocketReceived;
     this.socketListener.SocketSended    += this.SocketSended;
     this.tcpInPacketPool  = new TCPInPacketPool(capacity);
     this.tcpOutPacketPool = TCPOutPacketPool.getInstance();
     this.tcpOutPacketPool.initialize(capacity * 5);
     TCPCmdDispatcher.getInstance().initialize();
     this.dictInPackets     = new Dictionary <Socket, TCPInPacket>(capacity);
     this.gameServerClients = new Dictionary <Socket, GameServerClient>();
 }
Exemplo n.º 2
0
        public void initialize(int capacity)
        {
            socketListener = new SocketListener(capacity, (int)TCPCmdPacketSize.MAX_SIZE / 4);
            socketListener.SocketClosed    += SocketClosed;
            socketListener.SocketConnected += SocketConnected;
            socketListener.SocketReceived  += SocketReceived;
            socketListener.SocketSended    += SocketSended;

            tcpInPacketPool = new TCPInPacketPool(capacity);
/*            tcpOutPacketPool = new TCPOutPacketPool(capacity * 5);*/
            tcpOutPacketPool = TCPOutPacketPool.getInstance();
            tcpOutPacketPool.initialize(capacity * 5);
            TCPCmdDispatcher.getInstance().initialize();
            dictInPackets     = new Dictionary <Socket, TCPInPacket>(capacity);
            gameServerClients = new Dictionary <Socket, GameServerClient>();
        }