function.stream-socket-accept.html
来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 71 行
HTML
71 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Accept a connection on a socket created by stream_socket_server</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-set-write-buffer.html">stream_set_write_buffer</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.stream-socket-client.html">stream_socket_client</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-socket-accept" class="refentry"> <div class="refnamediv"> <h1 class="refname">stream_socket_accept</h1> <p class="verinfo">(PHP 5)</p><p class="refpurpose"><span class="refname">stream_socket_accept</span> — <span class="dc-title">Accept a connection on a socket created by <a href="function.stream-socket-server.html" class="function">stream_socket_server()</a></span></p> </div> <div class="refsect1 unknown"> <h3 class="title">Description</h3> <div class="methodsynopsis dc-description"> <span class="type">resource</span> <span class="methodname"><b><b>stream_socket_accept</b></b></span> ( <span class="methodparam"><span class="type">resource</span> <tt class="parameter">$server_socket</tt></span> [, <span class="methodparam"><span class="type">float</span> <tt class="parameter">$timeout</tt></span> [, <span class="methodparam"><span class="type">string</span> <tt class="parameter reference">&$peername</tt></span> ]] )</div> <p class="para rdfs-comment"> Accept a connection on a socket previously created by <a href="function.stream-socket-server.html" class="function">stream_socket_server()</a>. If <i><tt class="parameter">timeout</tt></i> is specified, the default socket accept timeout will be overridden with the time specified in seconds. The name (address) of the client which connected will be passed back in <i><tt class="parameter">peername</tt></i> if included and available from the selected transport. </p> <p class="simpara"> <i><tt class="parameter">peername</tt></i> can also be determined later using <a href="function.stream-socket-get-name.html" class="function">stream_socket_get_name()</a>. </p> <p class="simpara"> If the call fails, it will return <b><tt>FALSE</tt></b>. </p> <div class="warning"><b class="warning">Warning</b> <p class="para"> This function should not be used with UDP server sockets. Instead, use <a href="function.stream-socket-recvfrom.html" class="function">stream_socket_recvfrom()</a> and <a href="function.stream-socket-sendto.html" class="function">stream_socket_sendto()</a>. </p> </div> <p class="para"> See also <a href="function.stream-socket-server.html" class="function">stream_socket_server()</a>, <a href="function.stream-socket-get-name.html" class="function">stream_socket_get_name()</a>, <a href="function.stream-set-blocking.html" class="function">stream_set_blocking()</a>, <a href="function.stream-set-timeout.html" class="function">stream_set_timeout()</a>, <a href="function.fgets.html" class="function">fgets()</a>, <a href="function.fgetss.html" class="function">fgetss()</a>, <a href="function.fwrite.html" class="function">fwrite()</a>, <a href="function.fclose.html" class="function">fclose()</a>, <a href="function.feof.html" class="function">feof()</a>, and the <a href="ref.curl.html" class="link">Curl extension</a>. </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.stream-set-write-buffer.html">stream_set_write_buffer</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.stream-socket-client.html">stream_socket_client</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 + =
减小字号Ctrl + -
显示快捷键?