public function connect(float $connectTimeout = 1.0): Stream
    {
        $errno  = 0;
        $errstr = '';
        $fsockopen = $this->fsockopen;
        $resource = $fsockopen(
                $this->prefix . $this->host,
                $this->port,
                $errno,
                $errstr,
                $connectTimeout
        );
        if (false === $resource) {
            throw new ConnectionFailure(
                    'Connect to ' . $this->prefix . $this->host . ':'. $this->port
                    . ' within ' . $connectTimeout . ' second'
                    . (1 == $connectTimeout ? '' : 's') . ' failed: '
                    . $errstr . ' (' . $errno . ').'
            );
        }

        return new Stream($resource, $this->usesSsl());
    }