php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24924 timeout don't work - URGENT ISSUE
Submitted: 2003-08-03 13:24 UTC Modified: 2003-08-04 08:31 UTC
From: gdoroftei at sicme dot ro Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.3.3RC2 OS: RedHat 8
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: gdoroftei at sicme dot ro
New email:
PHP Version: OS:

 

 [2003-08-03 13:24 UTC] gdoroftei at sicme dot ro
Description:
------------
Hi,

I use fsockopen to query a list of sites. I wish that script to continue when the connection can't be made (after a give TIMEOUT).
I had tryed the last RC but no success.
question: if connection isn't made the script will continue after that TIMEOUT?
Thanks.

Reproduce code:
---------------
$this->TIMEOUT = 10;

This line is used in a while().

$ptr = @fsockopen($server,$this->PORT,$this->TIMEOUT);


Actual result:
--------------
When the site is down or the connection can't be made the script is blocked. No error, nothing.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-03 14:24 UTC] elmicha@php.net
Timeout is the 5th parameter of fsockopen, see <http://de.php.net/fsockopen>.
 [2003-08-04 07:41 UTC] gdoroftei at sicme dot ro
I did that, the same problem.
After few sites, the script is blocked.
thanks.
 [2003-08-04 08:31 UTC] vincent@php.net
Are you now using something like 
$ptr = @fsockopen($server,$this->PORT, $errno, $errstr, 
$this->TIMEOUT); 
 
did you try this? 
if(!$ptr){ 
echo "$errstr ($errno)"; 
} 
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 12:01:28 2024 UTC