php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15091 socket_set_timeout not part of windows binary
Submitted: 2002-01-17 18:28 UTC Modified: 2002-07-10 11:47 UTC
Votes:11
Avg. Score:4.9 ± 0.3
Reproduced:11 of 11 (100.0%)
Same Version:8 (72.7%)
Same OS:8 (72.7%)
From: Rajkumar dot Bellan at saint-gobain dot com Assigned:
Status: Closed Package: Sockets related
PHP Version: 4.1.1 OS: windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: Rajkumar dot Bellan at saint-gobain dot com
New email:
PHP Version: OS:

 

 [2002-01-17 18:28 UTC] Rajkumar dot Bellan at saint-gobain dot com
I am using windows binaries.

$fp = $fsockopen(($ip_addr, $port_no, $errno, $errstr, 30);
do {
   if (!feof($fp)) {
            $livedata = trim(fgets($fp,128));
             echo $livedata."\n";
    }
    else {
        break;
    }
} while(true);

when there is no data being sent by the server my script waits indefinitely at fgets. I tried using socket_set_blocking($fp, false) but that does get me data every one second. I tried to use socket_set_timeout that is when I found out it is not supported in windows binaries. Is there any other way to solve this problem in windows.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-17 18:32 UTC] Rajkumar dot Bellan at saint-gobain dot com
Correction to my earlier report. When using socket_set_blocking($fp, false) I am "not" getting data every one second
 [2002-01-18 10:04 UTC] sander@php.net
Why are you using $fsockopen and not fsockopen? That might be the cause of this bug.
 [2002-01-18 10:10 UTC] Rajkumar dot Bellan at saint-gobain dot com
correction that was a typo on my part. I did use fsockopen.
The program is working fine as long as there is data coming from the other side. But if there is no data the fgets call waits indefinitely without timing out. That is the reason I tried to use socket_set_timeout. Unfortunately i get the message that socket_set_timeout is not part of windows build.
 [2002-01-20 14:09 UTC] jjkil at hotmail dot com
PHP version: 4.1.1
Windows XP using IIS
Installed from the executable download.

Using the set_socket_timeout method causes the following error message to appear in the browser:

Warning: socket_set_timeout() is not supported in this PHP build in c:\inetpub\wwwroot\test.php on line 26
 [2002-07-10 11:47 UTC] jason@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 20:01:29 2024 UTC