<!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>Gets read timeout</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="stomp.error.html">Stomp::error</a></div> <div class="next" style="text-align: right; float: right;"><a href="stomp.getsessionid.html">Stomp::getSessionId</a></div> <div class="up"><a href="class.stomp.html">Stomp</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="stomp.getreadtimeout" class="refentry"> <div class="refnamediv"> <h1 class="refname">Stomp::getReadTimeout</h1> <h1 class="refname">stomp_get_read_timeout</h1> <p class="verinfo">(PECL stomp >= 0.3.0)</p><p class="refpurpose"><span class="refname">Stomp::getReadTimeout</span> -- <span class="refname">stomp_get_read_timeout</span> — <span class="dc-title">Gets read timeout</span></p> </div> <div class="refsect1 description" id="refsect1-stomp.getreadtimeout-description"> <h3 class="title">Description</h3> <p class="para">Object oriented style (method):</p> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="type">array</span> <span class="methodname"><strong>Stomp::getReadTimeout</strong></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment">Procedural style:</p> <div class="methodsynopsis dc-description"> <span class="type">array</span> <span class="methodname"><strong>stomp_get_read_timeout</strong></span> ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$link</code></span> )</div> <p class="para rdfs-comment"> Gets read timeout </p> </div> <div class="refsect1 parameters" id="refsect1-stomp.getreadtimeout-parameters"> <h3 class="title">Parameters</h3> <p class="para"> <dl> <dt> <span class="term"><em><code class="parameter">link</code></em></span><dd> <p class="para">Procedural style only: The stomp link identifier returned by <span class="function"><a href="stomp.construct.html" class="function">stomp_connect()</a></span>.</p></dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-stomp.getreadtimeout-returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns an array with 2 elements: sec and usec. </p> </div> <div class="refsect1 examples" id="refsect1-stomp.getreadtimeout-examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example" id="example-4646"> <p><strong>Example #1 Object oriented style</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">/* connection */<br /></span><span style="color: #007700">try {<br /> </span><span style="color: #0000BB">$stomp </span><span style="color: #007700">= new </span><span style="color: #0000BB">Stomp</span><span style="color: #007700">(</span><span style="color: #DD0000">'tcp://localhost:61613'</span><span style="color: #007700">);<br />} catch(</span><span style="color: #0000BB">StompException $e</span><span style="color: #007700">) {<br /> die(</span><span style="color: #DD0000">'Connection failed: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">$e</span><span style="color: #007700">-></span><span style="color: #0000BB">getMessage</span><span style="color: #007700">());<br />}<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$stomp</span><span style="color: #007700">-></span><span style="color: #0000BB">getReadTimeout</span><span style="color: #007700">());<br /><br /></span><span style="color: #FF8000">/* close connection */<br /></span><span style="color: #007700">unset(</span><span style="color: #0000BB">$stomp</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> array(2) { ["sec"]=> int(2) ["usec"]=> int(0) } </pre></div> </div> </div> </p> <p class="para"> <div class="example" id="example-4647"> <p><strong>Example #2 Procedural style</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">/* connection */<br /></span><span style="color: #0000BB">$link </span><span style="color: #007700">= </span><span style="color: #0000BB">stomp_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'ssl://localhost:61612'</span><span style="color: #007700">);<br /><br /></span><span style="color: #FF8000">/* check connection */<br /></span><span style="color: #007700">if (!</span><span style="color: #0000BB">$link</span><span style="color: #007700">) {<br /> die(</span><span style="color: #DD0000">'Connection failed: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">stomp_connect_error</span><span style="color: #007700">());<br />}<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">stomp_get_read_timeout</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">/* close connection */<br /></span><span style="color: #0000BB">stomp_close</span><span style="color: #007700">(</span><span style="color: #0000BB">$link</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span> </span> </code></div> </div> <div class="example-contents"><p>The above example will output something similar to:</p></div> <div class="example-contents screen"> <div class="cdata"><pre> array(2) { ["sec"]=> int(2) ["usec"]=> int(0) } </pre></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="stomp.error.html">Stomp::error</a></div> <div class="next" style="text-align: right; float: right;"><a href="stomp.getsessionid.html">Stomp::getSessionId</a></div> <div class="up"><a href="class.stomp.html">Stomp</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>