Ejemplo n.º 1
0
        public SuperServer(SuperServerConfig config)
        {
            if (config == null)
            {
                return;
            }
            _NumConnectedSockets = 0;
            _TotalBytesRead      = 0;
            IPAddress ip = IPAddress.Parse(config.IP);

            _Ipe               = new IPEndPoint(ip, config.Port);
            _NumConnections    = config.NumConnections;
            _ReceiveBufferSize = config.ReceiveBufferSize;

            _ReadWritePool = new SocketAsyncEventArgsPool(config.NumConnections);

            _BufferPool = new BufferManager(_ReceiveBufferSize * _NumConnections * opsToPreAlloc,
                                            _ReceiveBufferSize);

            _MaxNumberAcceptedClients = new Semaphore(_NumConnections, _NumConnections);
        }