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
 [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-2020 The PHP Group
All rights reserved.
Last updated: Mon Mar 30 14:01:24 2020 UTC