|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-10-13 21:55 UTC] pajoye@php.net
-Status: Open
+Status: Assigned
-Assigned To:
+Assigned To: mattficken
[2011-10-13 21:55 UTC] pajoye@php.net
[2011-10-14 23:37 UTC] mattficken@php.net
-Status: Assigned
+Status: Bogus
[2011-10-14 23:37 UTC] mattficken@php.net
[2011-10-15 06:33 UTC] ivan dot enderlin at hoa-project dot net
[2011-10-17 08:51 UTC] ivan dot enderlin at hoa-project dot net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Nov 04 17:00:01 2025 UTC |
Description: ------------ Sometimes, on Windows7 with PHP5.3+, stream_socket_recvfrom() returns false (the documentation says that it always returns a string but the source code says the opposite, it can return false), and I have no idea why. It happens only on Windows7 a priori. Basically, I have a client and a server as bellow. Test script: --------------- Client.php <?php $client = stream_socket_client( 'tcp://127.0.0.1:9001', $errno, $errstr, 30, STREAM_CLIENT_CONNECT ); echo 'Received '; var_dump(stream_socket_recvfrom($client, 6)); Server.php <?php $server = stream_socket_server( 'tcp://127.0.0.1:9001', $errno, $errstr, STREAM_SERVER_BIND | STREAM_SERVER_LISTEN ); echo 'Up & listen…', "\n"; $client = stream_socket_accept($server); echo 'New connection', "\n"; stream_socket_sendto($client, 'foobar'); echo 'Sent “foobar”', "\n"; Expected result: ---------------- Client.php Received: string(6) "foobar" Server.php Up & listen… New connection Sent “foobar” Actual result: -------------- Client.php Sometimes: Received: string(6) "foobar" Sometimes: Received: bool(false) Server.php Up & listen… New connection Sent “foobar”