PHP Australia Conference 2015

AMQPConnection::connect

(PECL amqp >= Unknown)

AMQPConnection::connectEstablish a connection with the AMQP broker.

Descrição

public bool AMQPConnection::connect ( void )

This method will initiate a connection with the AMQP broker.

Parâmetros

Esta função não possui parâmetros.

Valor Retornado

Retorna TRUE em caso de sucesso ou FALSE em caso de falha.

Exemplos

Exemplo #1 AMQPConnection::connect() example

<?php

/* Create a new connection */
$cnn = new AMQPConnection();

// set the login details
$cnn->setLogin('mylogin');
$cnn->setPassword('mypass');

if (
$cnn->connect()) {
    echo 
"Established a connection to the broker";
}
else {
    echo 
"Cannot connect to the broker";
}


?>

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top