Icicle\Http\Server\Server::__construct PHP Method

__construct() public method

public __construct ( Icicle\Http\Server\RequestHandler $handler, Log $log = null, Driver $driver = null, ServerFactory $factory = null )
$handler Icicle\Http\Server\RequestHandler
$log Log
$driver Driver
$factory ServerFactory
    public function __construct(RequestHandler $handler, Log $log = null, Driver $driver = null, ServerFactory $factory = null)
    {
        $this->handler = $handler;
        $this->log = $log ?: log();
        $this->driver = $driver ?: new Http1Driver();
        $this->factory = $factory ?: new DefaultServerFactory();
        $this->onError = function (Throwable $exception) {
            $this->close();
            throw $exception;
        };
    }