PHP 5.4.31 Released

AMQPConnection::reconnect

(PECL amqp >= Unknown)

AMQPConnection::reconnectCloses any open connection and creates a new connection with the AMQP broker.

Descrição

public bool AMQPConnection::reconnect ( void )

This method will close any open connections and initiate a new 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::reconnect() example

<?php

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

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

$cnn->connect();

// do something interesting


// ensure we have a valid connection
if (!$cnn->reconnect()) {
    echo 
"Could not reconnect to server";
}

?>

add a note add a note

User Contributed Notes

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