PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

AMQPConnection::setTimeout

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

AMQPConnection::setTimeoutSet the timeout.

Description

public bool AMQPConnection::setTimeout ( float $timeout )

Set the amount of time, in seconds, after which this instance of an AMQPConnection object times out a request to the broker. Setting this value will override the default value specified by the amqp.timeout INI setting. To specify a timeout of 500ms, simply pass in 0.5.

Parameters

timeout

The timeout used to connect to the AMQP broker.

Return Values

Returns TRUE on success or FALSE on failure.

Errors/Exceptions

Throws an AMQPConnectionException if timeout is longer less than 0.

Examples

Example #1 AMQPConnection::setTimeout example

<?php

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

// set the timeout
$cnn->setTimeout(5672);

?>

PHP Manual