<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.stream.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.stream-socket-shutdown.php',
    1 => 'stream_socket_shutdown',
    2 => 'Arr&ecirc;te une connexion full-duplex',
  ),
  'up' => 
  array (
    0 => 'ref.stream.php',
    1 => 'Fonctions sur les flux',
  ),
  'prev' => 
  array (
    0 => 'function.stream-socket-server.php',
    1 => 'stream_socket_server',
  ),
  'next' => 
  array (
    0 => 'function.stream-supports-lock.php',
    1 => 'stream_supports_lock',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/stream/functions/stream-socket-shutdown.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.stream-socket-shutdown" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_socket_shutdown</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.1, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">stream_socket_shutdown</span> &mdash; <span class="dc-title">Arrête une connexion full-duplex</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.stream-socket-shutdown-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>stream_socket_shutdown</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span> <code class="parameter">$stream</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$mode</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Arrête (partiellement ou non) une connexion full-duplex.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Le ou les buffers associés peuvent ou non être vidés.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.stream-socket-shutdown-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">stream</code></dt>
     <dd>
      <p class="para">
       Un flux ouvert (ouvert avec la fonction
       <span class="function"><a href="function.stream-socket-client.php" class="function">stream_socket_client()</a></span>, par exemple)
      </p>
     </dd>
    
    
     <dt><code class="parameter">mode</code></dt>
     <dd>
      <p class="para">
       Une des constantes suivantes : <strong><code><a href="stream.constants.php#constant.stream-shut-rd">STREAM_SHUT_RD</a></code></strong>
       (désactive les réceptions futures), <strong><code><a href="stream.constants.php#constant.stream-shut-wr">STREAM_SHUT_WR</a></code></strong>
       (désactive les transmissions futures) ou
       <strong><code><a href="stream.constants.php#constant.stream-shut-rdwr">STREAM_SHUT_RDWR</a></code></strong> (désactive les réceptions ou les
       transmissions futures).
      </p>
     </dd>
    
   </dl>
  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-function.stream-socket-shutdown-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.stream-socket-shutdown-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>stream_socket_shutdown()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$server </span><span style="color: #007700">= </span><span style="color: #0000BB">stream_socket_server</span><span style="color: #007700">(</span><span style="color: #DD0000">'tcp://127.0.0.1:1337'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$client </span><span style="color: #007700">= </span><span style="color: #0000BB">stream_socket_client</span><span style="color: #007700">(</span><span style="color: #DD0000">'tcp://127.0.0.1:1337'</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">fputs</span><span style="color: #007700">(</span><span style="color: #0000BB">$client</span><span style="color: #007700">, </span><span style="color: #DD0000">"Bonjour"</span><span style="color: #007700">));<br /><br /></span><span style="color: #0000BB">stream_socket_shutdown</span><span style="color: #007700">(</span><span style="color: #0000BB">$client</span><span style="color: #007700">, </span><span style="color: #0000BB">STREAM_SHUT_WR</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">fputs</span><span style="color: #007700">(</span><span style="color: #0000BB">$client</span><span style="color: #007700">, </span><span style="color: #DD0000">"Bonjour"</span><span style="color: #007700">)); </span><span style="color: #FF8000">// ne fonctionne actuellement pas<br /><br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>Résultat de l&#039;exemple ci-dessus est similaire à :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">int(5)

Notice: fputs(): send of 5 bytes failed with errno=32 Broken pipe in test.php on line 9
int(0)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.stream-socket-shutdown-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.fclose.php" class="function" rel="rdfs-seeAlso">fclose()</a> - Ferme un fichier</span></li>
   </ul>
  </p>
 </div>


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