function.socket-get-option.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 367 行 · 第 1/2 页
HTML
367 行
</td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_SNDBUF</td> <td colspan="1" rowspan="1" align="left"> Reports the size of the send buffer. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.integer.html" class="type int">int</a> </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_RCVBUF</td> <td colspan="1" rowspan="1" align="left"> Reports the size of the receive buffer. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.integer.html" class="type int">int</a> </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_ERROR</td> <td colspan="1" rowspan="1" align="left"> Reports information about error status and clears it. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.integer.html" class="type int">int</a> (cannot be set by <a href="function.socket-set-option.html" class="function">socket_set_option()</a>) </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_TYPE</td> <td colspan="1" rowspan="1" align="left"> Reports the <i><tt class="parameter">socket</tt></i> type (e.g. <b><tt>SOCK_STREAM</tt></b>). </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.integer.html" class="type int">int</a> (cannot be set by <a href="function.socket-set-option.html" class="function">socket_set_option()</a>) </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_DONTROUTE</td> <td colspan="1" rowspan="1" align="left"> Reports whether outgoing messages bypass the standard routing facilities. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.integer.html" class="type int">int</a> </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_RCVLOWAT</td> <td colspan="1" rowspan="1" align="left"> Reports the minimum number of bytes to process for <i><tt class="parameter">socket</tt></i> input operations. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.integer.html" class="type int">int</a> </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_RCVTIMEO</td> <td colspan="1" rowspan="1" align="left"> Reports the timeout value for input operations. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.array.html" class="type array">array</a>. The array will contain two keys: <var class="varname">sec</var> which is the seconds part on the timeout value and <var class="varname">usec</var> which is the microsecond part of the timeout value. </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_SNDTIMEO</td> <td colspan="1" rowspan="1" align="left"> Reports the timeout value specifying the amount of time that an output function blocks because flow control prevents data from being sent. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.array.html" class="type array">array</a>. The array will contain two keys: <var class="varname">sec</var> which is the seconds part on the timeout value and <var class="varname">usec</var> which is the microsecond part of the timeout value. </td> </tr> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">SO_SNDLOWAT</td> <td colspan="1" rowspan="1" align="left"> Reports the minimum number of bytes to process for <i><tt class="parameter">socket</tt></i> output operations. </td> <td colspan="1" rowspan="1" align="left"> <a href="language.types.integer.html" class="type int">int</a> </td> </tr> </tbody> </colgroup> </table> </dd> </dt> </dl> </p> </div> <div class="refsect1 returnvalues"> <h3 class="title">Return Values</h3> <p class="para"> Returns the value of the given option, or <b><tt>FALSE</tt></b> on errors. </p> </div> <div class="refsect1 examples"> <h3 class="title">Examples</h3> <p class="para"> <div class="example"> <p><b>Example #1 <a href="function.socket-set-option.html" class="function">socket_set_option()</a> example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?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 /><br /></span><span style="color: #0000BB">$linger </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'l_linger' </span><span style="color: #007700">=> </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #DD0000">'l_onoff' </span><span style="color: #007700">=> </span><span style="color: #0000BB">1</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">socket_set_option</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">, </span><span style="color: #0000BB">SOL_SOCKET</span><span style="color: #007700">, </span><span style="color: #0000BB">SO_LINGER</span><span style="color: #007700">, </span><span style="color: #0000BB">$linger</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">socket_get_option</span><span style="color: #007700">(</span><span style="color: #0000BB">$socket</span><span style="color: #007700">, </span><span style="color: #0000BB">SOL_SOCKET</span><span style="color: #007700">, </span><span style="color: #0000BB">SO_REUSEADDR</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?></span></span></code></div> </div> </div> </p> </div> <div class="refsect1 changelog"> <h3 class="title">ChangeLog</h3> <p class="para"> <table class="informaltable"> <colgroup> <thead valign="middle"> <tr valign="middle"> <th colspan="1">Version</th> <th colspan="1">Description</th> </tr> </thead> <tbody valign="middle" class="tbody"> <tr valign="middle"> <td colspan="1" rowspan="1" align="left">4.3.0</td> <td colspan="1" rowspan="1" align="left"> The name of this function was changed. It used to be called <i>socket_getopt()</i>. </td> </tr> </tbody> </colgroup> </table> </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.socket-create.html">socket_create</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.socket-getpeername.html">socket_getpeername</a></div> <div class="up"><a href="ref.sockets.html">Socket Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?