#36109 [Opn]: socket_sendto throws error
| From: | mike at normi dot net | Date: | Fri, 20 Jan 2006 20:04:05 +0000 |
| Subject: | #36109 [Opn]: socket_sendto throws error | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-92310@lists.php.net to get a copy of this message | ||
ID: 36109
User updated by: mike at normi dot net
Reported By: mike at normi dot net
Status: Open
Bug Type: Sockets related
Operating System: Windows 2003 Server
PHP Version: 5.1.2
New Comment:
Btw, webserver is IIS 6.0, but the same problem shows by executing the
script from the commandline.
Previous Comments:
------------------------------------------------------------------------
[2006-01-20 21:02:55] mike at normi dot net
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 this bug report at http://bugs.php.net/?id=36109&edit=1