php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #24867 problem with timeout parameter for fsockopen() function
Submitted: 2003-07-30 06:06 UTC Modified: 2005-01-15 20:00 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: tomato at pisem dot net Assigned:
Status: Not a bug Package: Sockets related
PHP Version: 4.3.2 OS: FreeBSD-4.7-Stable
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 you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: tomato at pisem dot net
New email:
PHP Version: OS:

 

 [2003-07-30 06:06 UTC] tomato at pisem dot net
Description:
------------
I'm trying to do socket connection with group of servers and for the server's that did not work function fsockopen() runs around 300-500 sec even the timeout is 10 sec.
i heard the problem was that this timeout used only in connect function, but not in gethostbyname
i read that you fixed this problem long time ago.. but my version is PHP 4.3.2RC4 (cli) (built: Jun 19 2003 14:41:09)
and the problem is still exists



 

Reproduce code:
---------------
$fp = fsockopen($href,$port,$errno,$errstr,10);


Expected result:
----------------
connect or failed to connect after 10 seconds or less

Actual result:
--------------
Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /.../script.php

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-01-15 20:00 UTC] wez@php.net
We can't put a timeout in gethostbyname().
The connect() timeout works fine on sane systems.
Note that FreeBSD has issues when connecting to filtered remote addresses; this is reportedly fixed in FreeBSD 5.3.
There is no bug here that PHP can fix; move along.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 06 15:01:30 2025 UTC