|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-11-03 17:03 UTC] wez@php.net
[2005-11-04 15:21 UTC] vrana@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 22:00:01 2025 UTC |
Description: ------------ Sample program tries to get data via UDP and never completes if none received. Use any IP address and port that does (or does not) exist and you get the same result if that IP does not send a UDP packet to the system this snippet is run on. Reproduce code: --------------- $server_recv = stream_socket_server("udp://192.168.1.100:9999", $errno, $errstr, STREAM_SERVER_BIND); if (!$server_recv) exit ("ERROR: stream_socket_server failed"); set_time_limit(2); // Will not interrupt stream_socket_recvfrom stream_set_timeout($server_recv,3,0); $packet=stream_socket_recvfrom($server_recv, 1000); $info = stream_get_meta_data($server_recv); if ($info['timed_out']) echo 'Connection timed out!'; else echo "Got back '$packet'"; Expected result: ---------------- Should timeout at 3 seconds. Actual result: -------------- Never comes back from stream_socket_recvfrom call.