<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.sockets.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'function.socket-shutdown.php',
    1 => 'socket_shutdown',
    2 => 'Shuts down a socket for receiving, sending, or both',
  ),
  'up' => 
  array (
    0 => 'ref.sockets.php',
    1 => 'Socket Functions',
  ),
  'prev' => 
  array (
    0 => 'function.socket-setopt.php',
    1 => 'socket_setopt',
  ),
  'next' => 
  array (
    0 => 'function.socket-strerror.php',
    1 => 'socket_strerror',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/sockets/functions/socket-shutdown.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.socket-shutdown" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">socket_shutdown</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">socket_shutdown</span> &mdash; <span class="dc-title">Shuts down a socket for receiving, sending, or both</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.socket-shutdown-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>socket_shutdown</strong></span>(<span class="methodparam"><span class="type"><a href="class.socket.php" class="type Socket">Socket</a></span> <code class="parameter">$socket</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 class="initializer"> = 2</span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   The <span class="function"><strong>socket_shutdown()</strong></span> function allows you to stop
   incoming, outgoing or all data (the default) from being sent through the
   <code class="parameter">socket</code>
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    The associated buffer, or buffers, may or may not be emptied.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.socket-shutdown-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">socket</code></dt>
     <dd>
      <p class="para">
       A <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span> instance created with <span class="function"><a href="function.socket-create.php" class="function">socket_create()</a></span>.
      </p>
     </dd>
    
    
     <dt><code class="parameter">mode</code></dt>
     <dd>
      <p class="para">
       The value of <code class="parameter">mode</code> can be one of the following:
       <table class="doctable table">
        <caption><strong>possible values for <code class="parameter">mode</code></strong></caption>
        
         <tbody class="tbody">
          <tr>
           <td><code class="literal">0</code></td>
           <td>
            Shutdown socket reading
           </td>
          </tr>

          <tr>
           <td><code class="literal">1</code></td>
           <td>
            Shutdown socket writing
           </td>
          </tr>

          <tr>
           <td><code class="literal">2</code></td>
           <td>
            Shutdown socket reading and writing
           </td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.socket-shutdown-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.socket-shutdown-changelog">
  <h3 class="title">Changelog</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
  <td>8.0.0</td>
  <td>
   <code class="parameter">socket</code> is a <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span> instance now;
   previously, it was a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>.
  </td>
 </tr>

    </tbody>
   
  </table>

 </div>

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