Re: [PHP-DEV] PHP 4.0 Bug #6778: fsockopen: timeout does not work when nameserver unreachable From: Flavien Lebarbé (flavien <email protected>)
Date: 09/25/00

[Re-sent]

thomas <email protected> wrote:
> When doing a plain
> fsockopen ("www.anyhost.com",$port,&$errno,&$errstr,$timeout) ...
> and the nameserver for this host does not respond, is unreachable
> or at least extremely slow (host www.anyhost.com produces 'A record
> not found'), fsockopen won't return after $timeout (3secs for example)!
> It hangs for at least 100-120 s.

Yes. I didn't try it, but I went through the code, and the timout
parameter is only used for the "connect", not for the "gethostbyname"
step, so the behaviour you're observing is totally understandable.

Does anybody have an idea of how to cleanly handle this ?
I'm not sure but I think someone's working on a new generic socket
interface will this particular issue be solved/solvable ?

Flavien Lebarbé.

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>