<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.ssh2.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'pt_BR',
  ),
  'this' => 
  array (
    0 => 'function.ssh2-set-timeout.php',
    1 => 'ssh2_set_timeout',
    2 => 'Set the timeout for blocking operations on a session',
  ),
  'up' => 
  array (
    0 => 'ref.ssh2.php',
    1 => 'Fun&ccedil;&otilde;es de SSH2',
  ),
  'prev' => 
  array (
    0 => 'function.ssh2-send-signal.php',
    1 => 'ssh2_send_signal',
  ),
  'next' => 
  array (
    0 => 'function.ssh2-sftp.php',
    1 => 'ssh2_sftp',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/ssh2/functions/ssh2-set-timeout.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.ssh2-set-timeout" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ssh2_set_timeout</h1>
  <p class="verinfo">(PECL ssh2 &gt;= 1.5.0)</p><p class="refpurpose"><span class="refname">ssh2_set_timeout</span> &mdash; <span class="dc-title">Set the timeout for blocking operations on a session</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.ssh2-set-timeout-description">
  <h3 class="title">Descrição</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">function</span> <span class="methodname"><strong>ssh2_set_timeout</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$session</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$seconds</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$microseconds</code><span class="initializer"> = 0</span></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="simpara">
   Sets how long a blocking operation on the given
   <code class="parameter">session</code> may wait before it is considered to have
   timed out.
  </p>
  <p class="simpara">
   When the resulting timeout is <code class="literal">0</code>, which is the default,
   no timeout is applied and blocking operations may wait indefinitely.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.ssh2-set-timeout-parameters">
  <h3 class="title">Parâmetros</h3>
  <dl>
   
    <dt><code class="parameter">session</code></dt>
    <dd>
     <p class="simpara">
      An SSH connection link identifier, obtained from a call to
      <span class="function"><a href="function.ssh2-connect.php" class="function">ssh2_connect()</a></span>.
     </p>
    </dd>
   
   
    <dt><code class="parameter">seconds</code></dt>
    <dd>
     <p class="simpara">
      The timeout, in seconds.
     </p>
    </dd>
   
   
    <dt><code class="parameter">microseconds</code></dt>
    <dd>
     <p class="simpara">
      An additional number of microseconds added to the timeout. The
      underlying library only supports millisecond precision, so this value
      is rounded up to the next whole millisecond.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.ssh2-set-timeout-returnvalues">
  <h3 class="title">Valor Retornado</h3>
  <p class="simpara">
   Nenhum valor é retornado.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.ssh2-set-timeout-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemplo #1 Limiting how long blocking operations may wait</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
$connection </span><span style="color: #007700">= </span><span style="color: #0000BB">ssh2_connect</span><span style="color: #007700">(</span><span style="color: #DD0000">'shell.example.com'</span><span style="color: #007700">, </span><span style="color: #0000BB">22</span><span style="color: #007700">);

</span><span style="color: #FF8000">// Give up on blocking operations after 5.5 seconds
</span><span style="color: #0000BB">ssh2_set_timeout</span><span style="color: #007700">(</span><span style="color: #0000BB">$connection</span><span style="color: #007700">, </span><span style="color: #0000BB">5</span><span style="color: #007700">, </span><span style="color: #0000BB">500000</span><span style="color: #007700">);

</span><span style="color: #0000BB">ssh2_auth_password</span><span style="color: #007700">(</span><span style="color: #0000BB">$connection</span><span style="color: #007700">, </span><span style="color: #DD0000">'username'</span><span style="color: #007700">, </span><span style="color: #DD0000">'password'</span><span style="color: #007700">);
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.ssh2-set-timeout-seealso">
  <h3 class="title">Veja também</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.ssh2-connect.php" class="function" rel="rdfs-seeAlso">ssh2_connect()</a> - Conecta-se a um servidor SSH</span></li>
   <li><span class="function"><a href="function.ssh2-keepalive-config.php" class="function" rel="rdfs-seeAlso">ssh2_keepalive_config()</a> - Configure how often keepalive messages should be sent</span></li>
   <li><span class="function"><a href="function.stream-set-timeout.php" class="function" rel="rdfs-seeAlso">stream_set_timeout()</a> - Define o limite de tempo em um fluxo</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>