Page 1 of 1

stream_set_timeout doesnt timeout

Posted: Tue Jun 07, 2005 6:12 am
by anjanesh

Code: Select all

$domain = "xxx.com";
$whois = "cwhois1.completewhois.com";
stream_set_timeout($fp, 2);
$fp = fsockopen($whois, 43, $errno, $errstr, 5);
This never ends and Im not able to get a timeout mechanism to check the domain from another whois server.

How I get the timeout ?

Thanks

Posted: Tue Jun 07, 2005 6:51 am
by Syranide
It's kinda hard settings timeout on something that doesn't exist.

You have to set it on the handle you get, but if I'm not mistaken, fsockopen does take a timeout-param? (which you might've set... but anyway)

Posted: Tue Jun 07, 2005 7:05 am
by anjanesh
xxx.com is to be searched from whois.opensrs.net but I woulnt know that initally so I check with some 3-4 whois servers until I get the whoisinfo.

But I cannot get past cwhois1.completewhois.com and continue with the rest of the whois servers because xxx.com with cwhois1.completewhois.com is going on forever.

Posted: Tue Jun 07, 2005 7:14 am
by Syranide
What I meant was that you set the timout on $fp ... which is NULL ... NULL might timeout, not to my knowledge though ;)

Then you overwrite it with a socket.

Posted: Tue Jun 07, 2005 7:46 am
by anjanesh
I did try having stream_set_timeout($fp, 2); after $fp = fsockopen($whois, 43, $errno, $errstr, 5); - no effect !

Posted: Tue Jun 07, 2005 8:02 am
by Syranide
but that's because it doesn't come to that point :P
but anyway, you have a timeout for fsockopen, which should timeout, however I don't know why it doesn't work, I believe I've had problems with it myself.