PHP Doku:: Closes any open connection and creates a new connection with the AMQP broker. - amqpconnection.reconnect.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzSonstige DiensteAMQPThe AMQPConnection classAMQPConnection::reconnect

Ein Service von Reinhard Neidl - Webprogrammierung.

The AMQPConnection class

<<AMQPConnection::isConnected

AMQPConnection::setHost>>

AMQPConnection::reconnect

(No version information available, might only be in SVN)

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

Beschreibung

public boolean AMQPConnection::reconnect ( void )

This method will close any open connections and initiate a new connection with the AMQP broker.

Parameter-Liste

void

Rückgabewerte

Returns true if reconnect was successful, false otherwise.

Beispiele

Beispiel #1 AMQPConnection::reconnect() example

<?php

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

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

if (!
$cnn->connect()) {
 throw new 
Exception('Could not connect');
}

// do something interesting

// ensure we have a valid connection
if (!$cnn->reconnect()) {
 throw new 
Exception('Could not reconnect');
}

?>


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)