Icicle\Http\Server\Server::accept PHP Method

accept() private method

private accept ( SocketServer $server, integer $cryptoMethod, float $timeout, boolean $allowPersistent ) : Generator
$server SocketServer
$cryptoMethod integer
$timeout float
$allowPersistent boolean
return Generator
    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;
                }
            }
        }
    }