Re: php conditional loop question
| From: | Curt Zirzow | Date: | Thu, 14 Aug 2003 02:18:38 +0000 |
| Subject: | Re: php conditional loop question | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159518@lists.php.net to get a copy of this message | ||
* Thus wrote Randy L Johnson Jr (rjohnson@seasidepc.com):
> I have done this but it does not seem to ever get to the end of file, I have
> it inserting the values into the database, it goes for awhile around 12 to
> 24 hours and then stops inserting the values into the database and I have to
> restart the script...
ah.. so it sound like the connection is dropping at some point thus
your socket becomes not usuable.
From my previous post you can use
http://php.net/stream_set_timeout
so if your fread comes back with no data you should exit the
function.
btw, any reason why your using pfsocketopen vs. just fsocketopen?
the pfsocketopen would be only needed if you plan on using that
socket on a different page request.
Come to think of it the pfsocketopen might even give you problems
even if you use the stream_set_timeout function.
HTH,
Curt
--
"I used to think I was indecisive, but now I'm not so sure."