public function start(HttpDriverFactory $driverFactory)
    {
        if ($this->readWatcher) {
            throw new \Error("Client already started");
        }

        $this->timeoutCache->renew($this->id);

        $this->writeWatcher = Loop::onWritable($this->socket, $this->callableFromInstanceMethod("onWritable"));
        Loop::disable($this->writeWatcher);

        $context = \stream_context_get_options($this->socket);
        if (isset($context["ssl"])) {
            $this->readWatcher = Loop::onReadable(
                $this->socket,
                $this->callableFromInstanceMethod("negotiateCrypto"),
                $driverFactory
            );
            return;
        }

        $this->setup($driverFactory->selectDriver($this));

        $this->readWatcher = Loop::onReadable($this->socket, $this->callableFromInstanceMethod("onReadable"));
    }
public function start(HttpDriverFactory $driverFactory)
    {
        if ($this->readWatcher) {
            throw new \Error("Client already started");
        }

        $this->timeoutCache->renew($this->id);

        $this->writeWatcher = Loop::onWritable($this->socket, $this->callableFromInstanceMethod("onWritable"));
        Loop::disable($this->writeWatcher);

        $context = \stream_context_get_options($this->socket);
        if (isset($context["ssl"])) {
            $this->readWatcher = Loop::onReadable(
                $this->socket,
                $this->callableFromInstanceMethod("negotiateCrypto"),
                $driverFactory
            );
            return;
        }

        $this->setup($driverFactory->selectDriver($this));

        $this->readWatcher = Loop::onReadable($this->socket, $this->callableFromInstanceMethod("onReadable"));
    }
public function start ( HttpDriverFactory $ driverFactory ) { if ( $ this -> readWatcher ) { throw new \ Error ( "Client already started" ) ; } $ this -> timeoutCache -> renew ( $ this -> id ) ; $ this -> writeWatcher = Loop :: onWritable ( $ this -> socket , $ this -> callableFromInstanceMethod ( "onWritable" ) ) ; Loop :: disable ( $ this -> writeWatcher ) ; $ context = \ stream_context_get_options ( $ this -> socket ) ; if ( isset ( $ context [ "ssl" ] ) ) { $ this -> readWatcher = Loop :: onReadable ( $ this -> socket , $ this -> callableFromInstanceMethod ( "negotiateCrypto" ) , $ driverFactory ) ; return ; } $ this -> setup ( $ driverFactory -> selectDriver ( $ this ) ) ; $ this -> readWatcher = Loop :: onReadable ( $ this -> socket , $ this -> callableFromInstanceMethod ( "onReadable" ) ) ; }
Listen for requests on the client and parse them using the given HTTP driver.

@param \Amp\Http\Server\Driver\HttpDriverFactory $driverFactory

@throws \Error If the client has already been started.
Listen for requests on the client and parse them using the given HTTP driver .