internal TestServer(int maxParallelClientCount, ServerControllerBase serverController) { _pool = new IOPool(); _serverController = serverController; _serverController.InitializePool(_pool); _pool.SetClientHandlers(_clientAccepted, _clientDisconnected); _pool.SetDataHandlers(_dataReceived, _dataBlockSent); _pool.StartListening(ServerPort); for (var i = 0; i < _clients.Length; ++i) { _clients[i] = new ServerClient(); } }
internal TestServer StartServer(ServerControllerBase serverController, int maxParallelClientCount = 1000) { if (_server != null) throw new NotSupportedException("Cannot start server twice"); _server = new TestServer(maxParallelClientCount, serverController); return _server; }