public function createConnection($host, $port, $password = null)
    {
        $socket = $this->socketFactory->createClient(sprintf('%s:%s', $host, $port));

        $conn = new Connection($socket);

        if (!empty($password)) {
            $conn->authenticate($password);
        }

        return $conn;
    }
public function createConnection($host, $port, $password = null)
    {
        $socket = $this->socketFactory->createClient(sprintf('%s:%s', $host, $port));

        $conn = new Connection($socket);

        if (!empty($password)) {
            $conn->authenticate($password);
        }

        return $conn;
    }
public function createConnection ( $ host , $ port , $ password = null ) { $ socket = $ this -> socketFactory -> createClient ( sprintf ( '%s:%s' , $ host , $ port ) ) ; $ conn = new Connection ( $ socket ) ; if ( ! empty ( $ password ) ) { $ conn -> authenticate ( $ password ) ; } return $ conn ; }
Creates a new Connection

@param string      $host
@param integer     $port
@param string|null $password

@return Connection
Creates a new Connection