From: mike at normi dot net Operating system: Windows 2003 Server PHP version: 5.1.2 PHP Bug Type: Sockets related Bug description: socket_sendto throws error
Description: ------------ The socket_sendto function doesn't seem to work. Even with the example code from the manual it throws an error. Any thoughts on this? phpinfo() @ http://hlstatsx.onlydutch.nl/test.php Result test script from manual @ http://hlstatsx.onlydutch.nl/test2.php Reproduce code: --------------- <?php $sh = socket_create(AF_INET, SOCK_STREAM, SOL_TCP); if (socket_bind($sh, '127.0.0.1', 4242)) { echo "Socket bound correctly"; } $buf = 'Test Message'; $len = strlen($buf); if (socket_sendto($sh, $buf, $len, 0x100, '192.168.0.2', 4242) !== false) { echo "Message sent correctly"; } socket_close($sh); ?> Expected result: ---------------- Socket bound correctly Message sent correctly Actual result: -------------- Socket bound correctly Warning: socket_sendto() [function.socket-sendto]: unable to write to socket [0]: The attempted operation is not supported for the type of object referenced. in D:\Home\LocalUser\onlydutch\sites\clanhost.nl\onlydutch\HTML\test2.php on line 8 -- Edit bug report at http://bugs.php.net/?id=36109&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=36109&r=trysnapshot44 Try a CVS snapshot (PHP 5.1): http://bugs.php.net/fix.php?id=36109&r=trysnapshot51 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=36109&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=36109&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=36109&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=36109&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=36109&r=needscript Try newer version: http://bugs.php.net/fix.php?id=36109&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=36109&r=support Expected behavior: http://bugs.php.net/fix.php?id=36109&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=36109&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=36109&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=36109&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=36109&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=36109&r=dst IIS Stability: http://bugs.php.net/fix.php?id=36109&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=36109&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=36109&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=36109&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=36109&r=mysqlcfg
