From:             pn2865 at yahoo dot com
Operating system: Linux or Win XP or Win2003
PHP version:      5.0.5
PHP Bug Type:     Sockets related
Bug description:  stream_set_timeout does not work with stream_socket_recvfrom

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.

-- 
Edit bug report at http://bugs.php.net/?id=35077&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=35077&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=35077&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=35077&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=35077&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=35077&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=35077&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=35077&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=35077&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=35077&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=35077&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=35077&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=35077&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=35077&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=35077&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=35077&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=35077&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=35077&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=35077&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=35077&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=35077&r=mysqlcfg

Reply via email to