📄 function.stream-set-blocking.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Set blocking/non-blocking mode on a stream</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.stream-select.html">stream_select</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.stream-set-timeout.html">stream_set_timeout</a></div> <div class="up"><a href="ref.stream.html">Stream Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.stream-set-blocking" class="refentry"> <div class="refnamediv"> <h1 class="refname">stream_set_blocking</h1> <p class="verinfo">(PHP 4 >= 4.3.0, PHP 5)</p><p class="refpurpose"><span class="refname">stream_set_blocking</span> — <span class="dc-title">Set blocking/non-blocking mode on a stream</span></p> </div> <div class="refsect1 unknown"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>stream_set_blocking</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$stream</tt></span> , <span class="methodparam"><span class="type">int</span> <tt class="parameter">$mode</tt></span> )</div> <p class="para rdfs-comment"> If <i><tt class="parameter">mode</tt></i> is 0, the given stream will be switched to non-blocking mode, and if 1, it will be switched to blocking mode. This affects calls like <a href="function.fgets.html" class="function">fgets()</a> and <a href="function.fread.html" class="function">fread()</a> that read from the stream. In non-blocking mode an <a href="function.fgets.html" class="function">fgets()</a> call will always return right away while in blocking mode it will wait for data to become available on the stream. </p> <p class="para"> Returns <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure. </p> <p class="para"> This function was previously called as <b>set_socket_blocking()</b> and later <a href="function.socket-set-blocking.html" class="function">socket_set_blocking()</a> but this usage is deprecated. </p> <blockquote><p><b class="note">Note</b>: <span class="simpara"> Prior to PHP 4.3, this function only worked on socket based streams. Since PHP 4.3, this function works for any stream that supports non-blocking mode (currently, regular files and socket streams). </span> </p></blockquote> <p class="para"> See also <a href="function.stream-select.html" class="function">stream_select()</a>. </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.stream-select.html">stream_select</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.stream-set-timeout.html">stream_set_timeout</a></div> <div class="up"><a href="ref.stream.html">Stream Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -