<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.socket-set-block.php',
    1 => 'socket_set_block',
    2 => 'Setzt einen Socket auf den blockieren-Modus',
  ),
  'up' => 
  array (
    0 => 'ref.sockets.php',
    1 => 'Socket-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.socket-sendto.php',
    1 => 'socket_sendto',
  ),
  'next' => 
  array (
    0 => 'function.socket-set-nonblock.php',
    1 => 'socket_set_nonblock',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/sockets/functions/socket-set-block.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.socket-set-block" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">socket_set_block</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.2.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">socket_set_block</span> &mdash; <span class="dc-title">Setzt einen Socket auf den blockieren-Modus</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.socket-set-block-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>socket_set_block</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="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Die Funktion <span class="function"><strong>socket_set_block()</strong></span> entfernt das Flag
   <strong><code><a href="dio.constants.php#constant.o-nonblock">O_NONBLOCK</a></code></strong> vom Socket <code class="parameter">socket</code>.
  </p>
  <p class="para">
   Wenn eine Operation (etwa empfangen, senden, verbinden, akzeptieren, ...)
   an einem blockierenden Socket ausgeführt wird, wird die Ausführung des
   Skripts so lange unterbrochen, bis es ein Signal erhält oder die Operation
   ausführen kann.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.socket-set-block-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">socket</code></dt>
     <dd>
      <p class="para">
       Eine <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span>-Instanz, die mit
       <span class="function"><a href="function.socket-create.php" class="function">socket_create()</a></span> oder
       <span class="function"><a href="function.socket-accept.php" class="function">socket_accept()</a></span> erzeugt wurde.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.socket-set-block-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt bei Erfolg <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> zurück. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
 </div>


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

    </thead>

    <tbody class="tbody">
     <tr>
  <td>8.0.0</td>
  <td>
   <code class="parameter">socket</code> ist nun eine
   <span class="classname"><a href="class.socket.php" class="classname">Socket</a></span>-Instanz; vorher war es eine
   <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>.
  </td>
 </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 examples" id="refsect1-function.socket-set-block-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>socket_set_block()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$socket </span><span style="color: #007700">= </span><span style="color: #0000BB">socket_create_listen</span><span style="color: #007700">(</span><span style="color: #0000BB">1223</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">socket_set_block</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">socket_accept</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>
     In diesem Beispiel wird ein Socket für alle Schnittstellen erzeugt, der
     den Port 1223 abhört und der in den <strong><code>O_BLOCK</code></strong>-Modus
     versetzt wird. <span class="function"><a href="function.socket-accept.php" class="function">socket_accept()</a></span> wartet auf eine
     Verbindung, um sie zu akzeptieren.
    </p></div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.socket-set-block-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.socket-set-nonblock.php" class="function" rel="rdfs-seeAlso">socket_set_nonblock()</a> - Setzt den nonblocking-Modus f&uuml;r den Dateideskriptor fd</span></li>
    <li><span class="function"><a href="function.socket-set-option.php" class="function" rel="rdfs-seeAlso">socket_set_option()</a> - Setzt die Optionen f&uuml;r einen Socket</span></li>
   </ul>
  </p>
 </div>


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