Re: php conditional loop question
| From: | Randy L Johnson Jr | Date: | Thu, 01 Jan 1970 00:00:00 +0000 |
| Subject: | Re: php conditional loop question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-159519@lists.php.net to get a copy of this message | ||
>>>>
I am running php as a client and I have the script running 24/7 to download
the data from the connection. Is there a function to see if the connection
drops. ??
is there a way to keep restart the function in the script. perhaps use a
while and exit the function with a number exit(3) and use that value as the
condition in the while?
Randy
* 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
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."
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
.