php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47973 stream_set_timeout no accept parameters smaller than 1 second
Submitted: 2009-04-15 16:11 UTC Modified: 2009-04-15 16:50 UTC
From: nyim at 163 dot com Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.2.9 OS: suse10 linux 32 bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: nyim at 163 dot com
New email:
PHP Version: OS:

 

 [2009-04-15 16:11 UTC] nyim at 163 dot com
Description:
------------
stream_set_timeout($udp, 0,300); 
just like 
stream_set_timeout($udp, 0);
it ignore the third parameter
strace the process:
poll([{fd=3, events=POLLIN|POLLERR|POLLHUP, revents=POLLERR}], 1, 0) = 1

Reproduce code:
---------------
<?php
$udp = stream_socket_client("udp://127.0.0.1:3434");
fwrite($udp,'xx');
stream_set_timeout($udp, 0,300);
$time = microtime(true);
fread($udp,1500);
echo microtime(true) - $time;

Expected result:
----------------
0.30182409286499

Actual result:
--------------
3.3140182495117E-5

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-15 16:50 UTC] nyim at 163 dot com
forgive me, the third parameter is microsecond, no millisecond
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC