newdocstyle

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@270261 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Hannes Magnusson 2008-12-01 20:07:51 +00:00
parent 60d3b35485
commit 992ca135fc

View file

@ -1,12 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- $Revision: 1.10 $ -->
<refentry xml:id="function.stream-socket-accept" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>stream_socket_accept</refname>
<refpurpose>Accept a connection on a socket created by <function>stream_socket_server</function></refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>resource</type><methodname>stream_socket_accept</methodname>
<methodparam><type>resource</type><parameter>server_socket</parameter></methodparam>
@ -15,20 +16,51 @@
</methodsynopsis>
<para>
Accept a connection on a socket previously created by
<function>stream_socket_server</function>. If
<parameter>timeout</parameter> 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 <parameter>peername</parameter>
if included and available from the selected transport.
<function>stream_socket_server</function>.
</para>
<simpara>
<parameter>peername</parameter> can also be determined later
using <function>stream_socket_get_name</function>.
</simpara>
<simpara>
If the call fails, it will return &false;.
</simpara>
</refsect1>
<refsect1 role="parameters"><!-- {{{ -->
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>timeout</parameter></term>
<listitem>
<para>
Override the default socket accept timeout. Time should be given in
seconds.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>peername</parameter></term>
<listitem>
<para>
Will be set to the name (address) of the client which connected, if
included and available from the selected transport.
</para>
<note>
<para>
Can also be determined later using
<function>stream_socket_get_name</function>.
</para>
</note>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1><!-- }}} -->
<refsect1 role="returnvalues"><!-- {{{ -->
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1><!-- }}} -->
<refsect1 role="notes"><!-- {{{ -->
&reftitle.notes;
<warning>
<para>
This function should not be used with UDP server sockets. Instead, use
@ -36,17 +68,26 @@
<function>stream_socket_sendto</function>.
</para>
</warning>
</refsect1><!-- }}} -->
<refsect1 role="seealso"><!-- {{{ -->
&reftitle.seealso;
<para>
See also <function>stream_socket_server</function>,
<function>stream_socket_get_name</function>,
<function>stream_set_blocking</function>,
<function>stream_set_timeout</function>,
<function>fgets</function>,
<function>fgetss</function>, <function>fwrite</function>,
<function>fclose</function>, <function>feof</function>, and
the <link linkend="ref.curl">Curl extension</link>.
<simplelist>
<member><function>stream_socket_server</function></member>
<member><function>stream_socket_get_name</function></member>
<member><function>stream_set_blocking</function></member>
<member><function>stream_set_timeout</function></member>
<member><function>fgets</function></member>
<member><function>fgetss</function></member>
<member><function>fwrite</function></member>
<member><function>fclose</function></member>
<member><function>feof</function></member>
<member><xref linkend="ref.curl" /></member>
</simplelist>
</para>
</refsect1>
</refsect1><!-- }}} -->
</refentry>
<!-- Keep this comment at the end of the file