php-doc-en/reference/sockets/functions/socket-create.xml

80 lines
2.6 KiB
XML
Raw Normal View History

<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.4 -->
<refentry id="function.socket-create">
<refnamediv>
<refname>socket_create</refname>
<refpurpose>Create a socket (endpoint for communication)</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<methodsynopsis>
<type>resource</type><methodname>socket_create</methodname>
<methodparam><type>int</type><parameter>domain</parameter></methodparam>
<methodparam><type>int</type><parameter>type</parameter></methodparam>
<methodparam><type>int</type><parameter>protocol</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
<para>
Creates a communication endpoint (a socket), and returns a
descriptor to the socket.
</para>
<para>
The <parameter>domain</parameter> parameter sets the
domain. Currently, <constant>AF_INET</constant> and
<constant>AF_UNIX</constant> are understood.
</para>
<para>
The <parameter>type</parameter> parameter selects the socket
type. This is one of <constant>SOCK_STREAM</constant>,
<constant>SOCK_DGRAM</constant>,
<constant>SOCK_SEQPACKET</constant>,
<constant>SOCK_RAW</constant>, <constant>SOCK_RDM</constant>, or
<constant>SOCK_PACKET</constant>.
</para>
<para>
<parameter>protocol</parameter> sets the protocol.
</para>
<para>
Returns a valid socket descriptor on success, or a negative error
code on failure. This code may be passed to
<function>socket_strerror</function> to get a textual explanation of the
error.
</para>
<para>
For more information on the usage of <function>socket_create</function>,
as well as on the meanings of the various parameters, see the
Unix man page socket (2).
</para>
<para>
See also
<function>socket_accept</function>,
<function>socket_bind</function>,
<function>socket_connect</function>,
<function>socket_listen</function>, and
<function>socket_strerror</function>.
</para>
</refsect1>
</refentry>
<!-- 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
sgml-default-dtd-file:"../../../../manual.ced"
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
-->