Re: PHP 4.0 Bug #6778: fsockopen: timeout does not work when nameserver unreachable

From: Date: Mon, 25 Sep 2000 23:25:44 +0000
Subject: Re: PHP 4.0 Bug #6778: fsockopen: timeout does not work when nameserver unreachable
Groups: php.dev 
Request: Send a blank email to php-dev+get-33652@lists.php.net to get a copy of this message
[Re-sent] thomas@kipar.de 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é.

« previous php.dev (#33652) next »