public function connect($host = null, $port = null)
    {
        $this->_host = null !== $host ? $host : $this->_host;
        $this->_port = null !== $port ? $port : $this->_port;
        if (false === $this->_ssh_resource = ssh2_connect($this->_host, $this->_port)) {
            throw new TransportException(sprintf('Enable to connect to %s:%i.', $this->_host, $this->_port));
        }

        return $this;
    }
public function connect($host = null, $port = null)
    {
        $this->_host = null !== $host ? $host : $this->_host;
        $this->_port = null !== $port ? $port : $this->_port;
        if (false === $this->_ssh_resource = ssh2_connect($this->_host, $this->_port)) {
            throw new TransportException(sprintf('Enable to connect to %s:%i.', $this->_host, $this->_port));
        }

        return $this;
    }
public function connect ( $ host = null , $ port = null ) { $ this -> _host = null !== $ host ? $ host : $ this -> _host ; $ this -> _port = null !== $ port ? $ port : $ this -> _port ; if ( false === $ this -> _ssh_resource = ssh2_connect ( $ this -> _host , $ this -> _port ) ) { throw new TransportException ( sprintf ( 'Enable to connect to %s:%i.' , $ this -> _host , $ this -> _port ) ) ; } return $ this ; }
Establish a SSH connection.

@param string $host
@param int    $port

@return \BackBee\Util\Transport\SFTP

@throws \BackBee\Util\Transport\Exception\TransportException Occurs if connection failed
Establish a SSH connection .