#38311 [NEW]: About the note in socket-getpeername's documentation

From: Date: Thu, 03 Aug 2006 10:23:08 +0000
Subject: #38311 [NEW]: About the note in socket-getpeername's documentation
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969373652@lists.php.net to get a copy of this message
From: axelluttgens at swing dot be Operating system: n/a PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: About the note in socket-getpeername's documentation 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 bug report at http://bugs.php.net/?id=38311&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38311&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38311&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38311&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38311&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38311&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38311&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=38311&r=needscript Try newer version: http://bugs.php.net/fix.php?id=38311&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38311&r=support Expected behavior: http://bugs.php.net/fix.php?id=38311&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38311&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38311&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38311&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38311&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38311&r=dst IIS Stability: http://bugs.php.net/fix.php?id=38311&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38311&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38311&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38311&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=38311&r=mysqlcfg

« previous php.doc (#969373652) next »