cvs: phpdoc /en/reference/sockets/functions socket-getpeername.xml socket-getsockname.xml
| From: | Sara Golemon | Date: | Fri, 18 Apr 2003 17:46:54 +0000 |
| Subject: | cvs: phpdoc /en/reference/sockets/functions socket-getpeername.xml socket-getsockname.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969352669@lists.php.net to get a copy of this message | ||
pollita Fri Apr 18 13:46:54 2003 EDT
Modified files:
/phpdoc/en/reference/sockets/functions socket-getpeername.xml
socket-getsockname.xml
Log:
DocBug #21366 plus info re: IPv6
Index: phpdoc/en/reference/sockets/functions/socket-getpeername.xml
diff -u phpdoc/en/reference/sockets/functions/socket-getpeername.xml:1.5
phpdoc/en/reference/sockets/functions/socket-getpeername.xml:1.6
--- phpdoc/en/reference/sockets/functions/socket-getpeername.xml:1.5 Wed May 1 12:07:19 2002
+++ phpdoc/en/reference/sockets/functions/socket-getpeername.xml Fri Apr 18 13:46:54 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.5 $ -->
+<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
<refentry id="function.socket-getpeername">
<refnamediv>
@@ -19,12 +19,12 @@
</methodsynopsis>
&warn.experimental.func;
<para>
- If the given socket is of type <constant>AF_INET</constant>,
- <function>socket_getpeername</function> will return the peers (remote)
- <emphasis>IP address</emphasis> in dotted-quad notation (e.g.
- <literal>127.0.0.1</literal>) in the <parameter>address</parameter>
- parameter and, if the optional <parameter>port</parameter> parameter is
- present, also the associated port.
+ If the given socket is of type <constant>AF_INET</constant>
+ or <constant>AF_INET6</constant>,
<function>socket_getpeername</function>
+ will return the peers (remote) <emphasis>IP address</emphasis> in appropriate
notation (e.g.
+ <literal>127.0.0.1</literal> or <literal>fe80::1</literal>) in the
+ <parameter>address</parameter> parameter and, if the optional
+ <parameter>port</parameter> parameter is present, also the associated port.
</para>
<para>
If the given socket is of type <constant>AF_UNIX</constant>,
@@ -32,15 +32,24 @@
path (e.g. <literal>/var/run/daemon.sock</literal>) in the
<parameter>address</parameter> parameter.
</para>
+ <note>
+ <simpara>
+ <function>socket_getpeername</function> should not be used with
+ <constant>AF_UNIX</constant> sockets created with
<function>socket_accept</function>.
+ Only sockets created with <function>socket_connect</function> or a primary
+ server socket following a call to <function>socket_bind</function> will return
+ meaningful values.
+ </simpara>
+ </note>
<para>
&return.success; <function>socket_getpeername</function> may also return
- &false; if the socket type is not any of <constant>AF_INET</constant> or
- <constant>AF_UNIX</constant>, in which case the last socket error code is
- <emphasis>not</emphasis> updated.
+ &false; if the socket type is not any of <constant>AF_INET</constant>,
+ <constant>AF_INET6</constant>, or <constant>AF_UNIX</constant>, in
which
+ case the last socket error code is <emphasis>not</emphasis> updated.
</para>
<para>
See also
- <function>socket_getpeername</function>,
+ <function>socket_getsockname</function>,
<function>socket_last_error</function> and
<function>socket_strerror</function>.
</para>
Index: phpdoc/en/reference/sockets/functions/socket-getsockname.xml
diff -u phpdoc/en/reference/sockets/functions/socket-getsockname.xml:1.3
phpdoc/en/reference/sockets/functions/socket-getsockname.xml:1.4
--- phpdoc/en/reference/sockets/functions/socket-getsockname.xml:1.3 Wed May 1 12:07:30 2002
+++ phpdoc/en/reference/sockets/functions/socket-getsockname.xml Fri Apr 18 13:46:54 2003
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.3 $ -->
+<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
<refentry id="function.socket-getsockname">
<refnamediv>
@@ -19,12 +19,12 @@
</methodsynopsis>
&warn.experimental.func;
<para>
- If the given socket is of type <constant>AF_INET</constant>,
- <function>socket_getsockname</function> will return the local
- <emphasis>IP address</emphasis> in dotted-quad notation (e.g.
- <literal>127.0.0.1</literal>) in the <parameter>address</parameter>
- parameter and, if the optional <parameter>port</parameter> parameter is
- present, also the associated port.
+ If the given socket is of type <constant>AF_INET</constant>
+ or <constant>AF_INET6</constant>,
<function>socket_getsockname</function>
+ will return the local <emphasis>IP address</emphasis> in appropriate notation
(e.g.
+ <literal>127.0.0.1</literal> or <literal>fe80::1</literal>) in the
+ <parameter>address</parameter> parameter and, if the optional
+ <parameter>port</parameter> parameter is present, also the associated port.
</para>
<para>
If the given socket is of type <constant>AF_UNIX</constant>,
@@ -32,11 +32,20 @@
path (e.g. <literal>/var/run/daemon.sock</literal>) in the
<parameter>address</parameter> parameter.
</para>
+ <note>
+ <simpara>
+ <function>socket_getsockname</function> should not be used with
+ <constant>AF_UNIX</constant> sockets created with
<function>socket_connect</function>.
+ Only sockets created with <function>socket_accept</function> or a primary
+ server socket following a call to <function>socket_bind</function> will return
+ meaningful values.
+ </simpara>
+ </note>
<para>
&return.success; <function>socket_getsockname</function> may also return
- &false; if the socket type is not any of <constant>AF_INET</constant> or
- <constant>AF_UNIX</constant>, in which case the last socket error code is
- <emphasis>not</emphasis> updated.
+ &false; if the socket type is not any of <constant>AF_INET</constant>,
+ <constant>AF_INET6</constant>, or <constant>AF_UNIX</constant>, in
which
+ case the last socket error code is <emphasis>not</emphasis> updated.
</para>
<para>
See also