2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 09:08:43 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-12-30 00:26:59 +00:00
|
|
|
<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>
|
2008-12-01 20:07:51 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-12-30 00:26:59 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>resource</type><methodname>stream_socket_accept</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>server_socket</parameter></methodparam>
|
2009-01-16 16:14:26 +00:00
|
|
|
<methodparam choice="opt"><type>float</type><parameter>timeout</parameter><initializer>ini_get("default_socket_timeout")</initializer></methodparam>
|
2007-12-30 00:26:59 +00:00
|
|
|
<methodparam choice="opt"><type>string</type><parameter role="reference">peername</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
|
|
Accept a connection on a socket previously created by
|
2008-12-01 20:07:51 +00:00
|
|
|
<function>stream_socket_server</function>.
|
2007-12-30 00:26:59 +00:00
|
|
|
</para>
|
2008-12-01 20:07:51 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters"><!-- {{{ -->
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
2010-05-18 09:09:18 +00:00
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>server_socket</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The server socket to accept a connection from.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2008-12-01 20:07:51 +00:00
|
|
|
<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>
|
2010-05-18 11:00:11 +00:00
|
|
|
Returns a stream to the accepted socket connection&return.falseforfailure;.
|
2008-12-01 20:07:51 +00:00
|
|
|
</para>
|
|
|
|
</refsect1><!-- }}} -->
|
|
|
|
|
|
|
|
<refsect1 role="notes"><!-- {{{ -->
|
|
|
|
&reftitle.notes;
|
2007-12-30 00:26:59 +00:00
|
|
|
<warning>
|
|
|
|
<para>
|
|
|
|
This function should not be used with UDP server sockets. Instead, use
|
|
|
|
<function>stream_socket_recvfrom</function> and
|
|
|
|
<function>stream_socket_sendto</function>.
|
|
|
|
</para>
|
|
|
|
</warning>
|
2008-12-01 20:07:51 +00:00
|
|
|
</refsect1><!-- }}} -->
|
|
|
|
|
|
|
|
<refsect1 role="seealso"><!-- {{{ -->
|
|
|
|
&reftitle.seealso;
|
2007-12-30 00:26:59 +00:00
|
|
|
<para>
|
2008-12-01 20:07:51 +00:00
|
|
|
<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>
|
2007-12-30 00:26:59 +00:00
|
|
|
</para>
|
2008-12-01 20:07:51 +00:00
|
|
|
</refsect1><!-- }}} -->
|
|
|
|
|
2007-12-30 00:26:59 +00:00
|
|
|
</refentry>
|
2003-04-04 21:01:35 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2003-04-04 21:01:35 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|