#38311 [Opn->Fbk]: About the note in socket-getpeername's documentation
| From: | vrana@php.net | Date: | Fri, 17 Aug 2007 18:32:08 +0000 |
| Subject: | #38311 [Opn->Fbk]: About the note in socket-getpeername's documentation | ||
| References: | 1 | Groups: | php.doc |
| Request: | Send a blank email to phpdoc+get-969377665@lists.php.net to get a copy of this message | ||
ID: 38311
Updated by: vrana@php.net
Reported By: axelluttgens at swing dot be
-Status: Open
+Status: Feedback
Bug Type: Documentation problem
Operating System: n/a
PHP Version: Irrelevant
New Comment:
Can you please consult bug #21366?
Previous Comments:
------------------------------------------------------------------------
[2006-08-03 10:23:08] axelluttgens at swing dot be
Description:
------------
I really don't understand following sentence, appearing at
manual/en/function.socket-getpeername.php:
Note: socket_getpeername() should not be used with
AF_UNIX sockets created with socket_accept(). Only
sockets created with socket_connect() or a primary
server socket following a call to socket_bind() will
return meaningful values.
For example,
$connection = socket_accept($endpoint);
socket_getpeername($connection, $peer, $peerport);
works perfectly well (one gets client's address and port).
More generally, above excerpt tends to remove a good deal of the
generality of the getpeername(2) system call.
It seems that some kind of cut/paste errors occured while writing above
note. For example, perhaps should it have read:
Note: socket_getpeername() should not be used with
AF_UNIX sockets created with socket_create(). Only
sockets created with socket_connect() or a primary
server socket following a call to socket_accept() will
return meaningful values.
But even so, it would remain somewhat obscure.
HTH,
Axel
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38311&edit=1