From: mark-phpbugs at vectrex dot org dot uk Operating system: Linux 2.6, Debian PHP version: 5.1.1 PHP Bug Type: Sockets related Bug description: stream_socket_sendto does not work with Unix sockets
Description: ------------ No valid parameter exists for stream_socket_sendto with unix sockets; you can call it but it won't work under any circumstances. Reproduce code: --------------- <?php /* Because we can't open a unix socket without specifying a path, specify a dummy path. Note that we use "0" for flags so it doesn't connect. */ error_reporting(E_ALL); $sockpath = "/tmp/testsocket"; $errno = 0; $errstr = ""; $sock = stream_socket_server("udg://$sockpath", $errno, $errstr, 0 /* Flags*/ ); $msg = "Hello"; stream_socket_sendto($sock, $msg, 0 /* flags */, "udg:///tmp/anothersocket"); ?> Expected result: ---------------- Send a Unix datagram containing "Hello" to socket /tmp/anothersocket Actual result: -------------- Warning: stream_socket_sendto(): php_network_getaddresses: getaddrinfo failed: Name or service not known in /home/mark/progs/betterforum/site/udgsendtotest.php on line 14 Warning: stream_socket_sendto(): Failed to parse `udg:///tmp/anothersocket' into a valid network address in /home/mark/progs/betterforum/site/udgsendtotest.php on line 14 -- Edit bug report at http://bugs.php.net/?id=35533&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=35533&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=35533&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=35533&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=35533&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=35533&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=35533&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=35533&r=needscript Try newer version: http://bugs.php.net/fix.php?id=35533&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=35533&r=support Expected behavior: http://bugs.php.net/fix.php?id=35533&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=35533&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=35533&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=35533&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=35533&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=35533&r=dst IIS Stability: http://bugs.php.net/fix.php?id=35533&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=35533&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=35533&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=35533&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=35533&r=mysqlcfg