<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Set the timeout.</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="amqpconnection.setport.html">AMQPConnection::setPort</a></div> <div class="next" style="text-align: right; float: right;"><a href="amqpconnection.setvhost.html">AMQPConnection::setVhost</a></div> <div class="up"><a href="class.amqpconnection.html">AMQPConnection</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="amqpconnection.settimeout" class="refentry"> <div class="refnamediv"> <h1 class="refname">AMQPConnection::setTimeout</h1> <p class="verinfo">(No version information available, might only be in SVN)</p><p class="refpurpose"><span class="refname">AMQPConnection::setTimeout</span> — <span class="dc-title">Set the timeout.</span></p> </div> <div class="refsect1 description" id="refsect1-amqpconnection.settimeout-description"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">bool</span> <span class="methodname"><strong>AMQPConnection::setTimeout</strong></span> ( <span class="methodparam"><span class="type">float</span> <code class="parameter">$timeout</code></span> )</div> <p class="para rdfs-comment"> Set the amount of time, in seconds, after which this instance of an <a href="class.amqpconnection.html" class="classname">AMQPConnection</a> object times out a request to the broker. Setting this value will override the default value specified by the <em>amqp.timeout</em> INI setting. To specify a timeout of 500ms, simply pass in 0.5. </p> </div> <div class="refsect1 parameters" id="refsect1-amqpconnection.settimeout-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">timeout</code></em></span> <dd> <p class="para"> The timeout used to connect to the AMQP broker. </p> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-amqpconnection.settimeout-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure. </p> </div> <div class="refsect1 errors" id="refsect1-amqpconnection.settimeout-errors"> <h3 class="title">Errors/Exceptions</h3> <p class="para"> Throws an <strong class="classname">AMQPConnectionException</strong> if <em><code class="parameter">timeout</code></em> is longer less than 0. </p> </div> <div class="refsect1 examples" id="refsect1-amqpconnection.settimeout-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4195"> <p><strong>Example #1 <span class="methodname"><strong>AMQPConnection::setTimeout()</strong></span> example</strong></p> <div class="example-contents"> <div class="phpcode"><code><span style="color: #000000"> <span style="color: #0000BB"><?php<br /><br /></span><span style="color: #FF8000">/* Create a new connection */<br /></span><span style="color: #0000BB">$cnn </span><span style="color: #007700">= new </span><span style="color: #0000BB">AMQPConnection</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// set the timeout<br /></span><span style="color: #0000BB">$cnn</span><span style="color: #007700">-></span><span style="color: #0000BB">setTimeout</span><span style="color: #007700">(</span><span style="color: #0000BB">5672</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> </div> </p> </div> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="amqpconnection.setport.html">AMQPConnection::setPort</a></div> <div class="next" style="text-align: right; float: right;"><a href="amqpconnection.setvhost.html">AMQPConnection::setVhost</a></div> <div class="up"><a href="class.amqpconnection.html">AMQPConnection</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>