<?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 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.stream-set-blocking.php',
    1 => 'stream_set_blocking',
    2 => 'Set blocking/non-blocking mode on a stream',
  ),
  'up' => 
  array (
    0 => 'ref.stream.php',
    1 => 'Stream-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.stream-select.php',
    1 => 'stream_select',
  ),
  'next' => 
  array (
    0 => 'function.stream-set-chunk-size.php',
    1 => 'stream_set_chunk_size',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/stream/functions/stream-set-blocking.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.stream-set-blocking" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">stream_set_blocking</h1>
  <p class="verinfo">(PHP 4 &gt;= 4.3.0, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">stream_set_blocking</span> &mdash; <span class="dc-title">Set blocking/non-blocking mode on a stream</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.stream-set-blocking-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>stream_set_blocking</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.boolean.php" class="type bool">bool</a></span> <code class="parameter">$enable</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Sets blocking or non-blocking mode on a <code class="parameter">stream</code>.
  </p>
  <p class="para">
   This function works for any stream that supports non-blocking mode
   (currently, regular files and socket streams).
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.stream-set-blocking-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">stream</code></dt>
     <dd>
      <p class="para">
       The stream.
      </p>
     </dd>
    
    
     <dt><code class="parameter">enable</code></dt>
     <dd>
      <p class="para">
       If <code class="parameter">enable</code> is <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>, the given stream
       will be switched to non-blocking mode, and if <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong>, it
       will be switched to blocking mode.  This affects calls like
       <span class="function"><a href="function.fgets.php" class="function">fgets()</a></span> and <span class="function"><a href="function.fread.php" class="function">fread()</a></span>
       that read from the stream.  In non-blocking mode an
       <span class="function"><a href="function.fgets.php" class="function">fgets()</a></span> call will always return right away
       while in blocking mode it will wait for data to become available
       on the stream.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.stream-set-blocking-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 notes" id="refsect1-function.stream-set-blocking-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <p class="para">On Windows, this has no affect on local files. Non-blocking IO for local files is not supported on Windows.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.stream-set-blocking-seealso">
  <h3 class="title">Siehe auch</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.stream-select.php" class="function" rel="rdfs-seeAlso">stream_select()</a> - Runs the equivalent of the select() system call on the given
   arrays of streams with a timeout specified by seconds and microseconds</span></li>
  </ul>
 </div>

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