mfischer Wed May 1 11:52:42 2002 EDT
Modified files:
/phpdoc/en/reference/sockets/functions socket-getpeername.xml
Log:
- Initial documentation.
Index: phpdoc/en/reference/sockets/functions/socket-getpeername.xml
diff -u phpdoc/en/reference/sockets/functions/socket-getpeername.xml:1.2
phpdoc/en/reference/sockets/functions/socket-getpeername.xml:1.3
--- phpdoc/en/reference/sockets/functions/socket-getpeername.xml:1.2 Wed Apr 17
02:44:08 2002
+++ phpdoc/en/reference/sockets/functions/socket-getpeername.xml Wed May 1
+11:52:41 2002
@@ -1,10 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.2 $ -->
+<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/sockets.xml, last change in rev 1.27 -->
<refentry id="function.socket-getpeername">
<refnamediv>
<refname>socket_getpeername</refname>
- <refpurpose>Given an fd, stores a string representing sa.sin_addr and the value
of sa.sin_port into addr and port describing the remote side of a socket </refpurpose>
+ <refpurpose>
+ Queries the local side of the given socket which may either result in host/port
+ or in a UNIX filesystem path, dependent on its type.
+ </refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
@@ -16,7 +19,24 @@
</methodsynopsis>
&warn.experimental.func;
<para>
- &warn.undocumented.func;
+ If the given socket is of type <constant>AF_INET</constant>,
+ <function>socket_getpeername</function> will return the peers
+ <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.
+ </para>
+ <para>
+ If the given socket is of type <constant>AF_UNIX</constant>,
+ <function>socket_getpeername</function> will return the UNIX filesystem
+ path (e.g. <literal>/var/run/daemon.sock</literal>) in the
+ <parameter>address</parameter> parameter.
+ </para>
+ <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.
</para>
</refsect1>
</refentry>