<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'function.stream-set-blocking.php',
    1 => 'stream_set_blocking',
    2 => 'ストリームのブロックモードを有効にする / 解除する',
  ),
  'up' => 
  array (
    0 => 'ref.stream.php',
    1 => 'ストリーム 関数',
  ),
  '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' => 'ja',
    '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">ストリームのブロックモードを有効にする / 解除する</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.stream-set-blocking-description">
  <h3 class="title">説明</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">
   <code class="parameter">stream</code> のモードをブロックあるいは非ブロックに設定します。
  </p>
  <p class="para">
   この関数は、非ブロックモードをサポートするすべてのストリーム
   (現在は、通常のファイルストリームとソケットストリームのみ)
   において利用可能です。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.stream-set-blocking-parameters">
  <h3 class="title">パラメータ</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">stream</code></dt>
     <dd>
      <p class="para">
       ストリーム。
      </p>
     </dd>
    
    
     <dt><code class="parameter">enable</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">enable</code> が <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> の時、ストリームは
       非ブロックモードに切り替えられ、<strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> の場合は、
       ブロックモードに切り替えられます。このモードの違いは、
       <span class="function"><a href="function.fgets.php" class="function">fgets()</a></span> や <span class="function"><a href="function.fread.php" class="function">fread()</a></span>
       といった、ストリームからデータを読む関数に影響します。
       非ブロックモードにおいては <span class="function"><a href="function.fgets.php" class="function">fgets()</a></span> を呼び出すと
       どんな場合でもただちに呼び出し元に戻りますが、ブロックモードの場合では、
       ストリームがデータを読み出せる状態になるまで待ちつづけます。
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.stream-set-blocking-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   成功した場合に <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> を、失敗した場合に <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> を返します。
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.stream-set-blocking-notes">
  <h3 class="title">注意</h3>
  <blockquote class="note"><p><strong class="note">注意</strong>: 
   <p class="para">
    Windowsでは、これはローカルファイルには影響しません。
    ローカルファイルのノンブロッキングI/Oは、Windowsではサポートされていません。
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.stream-set-blocking-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="function.stream-select.php" class="function" rel="rdfs-seeAlso">stream_select()</a> - select() システムコールと同等の操作を、
   ストリームの配列に対して seconds と microseconds で指定されたタイムアウト時間をもって行う</span></li>
  </ul>
 </div>

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