private function accept(SocketServer $server, int $cryptoMethod, float $timeout, bool $allowPersistent) : \Generator
{
yield from $this->log->log(Log::INFO, 'HTTP server listening on %s:%d', $server->getAddress(), $server->getPort());
while ($server->isOpen()) {
try {
$coroutine = new Coroutine($this->process(yield from $server->accept(), $cryptoMethod, $timeout, $allowPersistent));
$coroutine->done(null, $this->onError);
} catch (Throwable $exception) {
if ($this->isOpen()) {
throw $exception;
}
}
}
}