http.php
public function createConnection($method, $timeout)
    {
        $default_port = ('https' === $this->url->getScheme()) ? 443 : 80;
        $socket       = $this->createSocket(
                $this->url->getScheme() ? $this->url->getScheme() : 'http',
                $this->url->getHost(),
                $this->url->getPort() ? $this->url->getPort() : $default_port,
                $timeout);
        if (! $socket->isError()) {
            $socket->write($this->getRequestLine($method) . "\r\n");
            $socket->write($this->getHostLine() . "\r\n");
            $socket->write("Connection: close\r\n");
        }

        return $socket;
    }
public function createConnection($method, $timeout)
    {
        $default_port = ('https' === $this->url->getScheme()) ? 443 : 80;
        $socket       = $this->createSocket(
                $this->url->getScheme() ? $this->url->getScheme() : 'http',
                $this->url->getHost(),
                $this->url->getPort() ? $this->url->getPort() : $default_port,
                $timeout);
        if (! $socket->isError()) {
            $socket->write($this->getRequestLine($method) . "\r\n");
            $socket->write($this->getHostLine() . "\r\n");
            $socket->write("Connection: close\r\n");
        }

        return $socket;
    }
Opens a socket to the route.

@param string $method      HTTP request method, usually GET.
@param int $timeout    Connection timeout.

@return SimpleSocket       New socket.