Re: re:Timing out an fgets

From: Date: Fri, 18 Aug 2000 02:30:56 +0000
Subject: Re: re:Timing out an fgets
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-12398@lists.php.net to get a copy of this message
David Robley wrote: > > set_connection_timeout(10); > > > > while ( connection_timeout() == 0 ) { > > fgets($fp,1024); > > or die("No response"); > > if ( connection_timeout() == 1 ) { > > die("Connection Timed Out"); > > } > > } > > > >The manual says that connection_timeout returns true if the script has > timed out. But in your example above, shouldn't you be setting > max_execution_time to reset the timeout? I can't see a > set_connection_timeout anywhere in the docs? > > Also, if you are using fsockopen, is the timeout argument not > functional? > > Some theoretical thoughts from someone who has never used this stuff :-) > Yes I am wrong should be set_time_limit() But for some reason the max_execution_time variable in the php.ini is not working as my script will sit there for 5 mins trying to receive the fgets, this is why I originally was trying to timeout the fgets function, until I found that I could possibly timeout the whole script and take measures to recover from this situation. Yes the fsockopen timeout is functional, and there is no problem opening the socket, just the application I am connecting too is set not to return a response, so when I call fgets it just keeps going until the actual page times out, at least I am pretty sure of this. Thanks for your thoughts, I might try setting the timeout again to see what happens. Cheers, Joseph Blythe

« previous php.general (#12398) next »