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

contributors($setup);

?>
<div id="function.socket-set-nonblock" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">socket_set_nonblock</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.1.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">socket_set_nonblock</span> &mdash; <span class="dc-title">Setzt den nonblocking-Modus für den Dateideskriptor fd</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.socket-set-nonblock-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>socket_set_nonblock</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_nonblock()</strong></span> setzt das Flag
   <strong><code><a href="dio.constants.php#constant.o-nonblock">O_NONBLOCK</a></code></strong> für den Socket <code class="parameter">socket</code>.
  </p>
  <p class="para">
   Wenn eine Operation (etwa empfangen, senden, verbinden, akzeptieren, ...)
   an einem nicht-blockierenden Socket ausgeführt wird, wird die Ausführung
   des Skripts so lange nicht unterbrochen, bis es ein Signal erhält oder die
   Operation ausgeführt ist. Wenn allerdings die Operation zu einer
   Blockierung führen würde, schlägt die aufgerufene Funktion fehl.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.socket-set-nonblock-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-nonblock-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-nonblock-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-nonblock-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_nonblock()</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_nonblock</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><a href="dio.constants.php#constant.o-nonblock">O_NONBLOCK</a></code></strong>-Modus
     versetzt wird. <span class="function"><a href="function.socket-accept.php" class="function">socket_accept()</a></span> schlägt sofort fehl, es
     sei denn, es gibt exakt in diesem Moment eine wartende Verbindung.
    </p></div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.socket-set-nonblock-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.socket-set-block.php" class="function" rel="rdfs-seeAlso">socket_set_block()</a> - Setzt einen Socket auf den blockieren-Modus</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>
    <li><span class="function"><a href="function.stream-set-blocking.php" class="function" rel="rdfs-seeAlso">stream_set_blocking()</a> - Set blocking/non-blocking mode on a stream</span></li>
   </ul>
  </p>
 </div>


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