Re: Timeout Function:
| From: | (Stig Sæther Bakken) | Date: | Tue, 24 Apr 2001 23:18:17 +0000 |
| Subject: | Re: Timeout Function: | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-52331@lists.php.net to get a copy of this message | ||
[Jason Sims <jason@insidemacgames.com>]
> > Personally, I think having an alarm (timeout) function is a really good
> > idea.
> >
> > Setting a timer, and then being able to jump from whatever you are doing if
> > it is taking too long is something that has helped me do some really neat
> > stuff in C and Perl... and I was a little dissapointed when I learned PHP
> > didn't have.
>
> Although I've been able to solve my current problem with fsockopen(), I
> think an alarm function would be nice to have for other things. Perl is
> open-source, right? Probably the best way to implement this in PHP would be
> to look at how Perl is doing it and go from there.
It's not that simple in PHP. Perl is a standalone environment, so you
can use signals to your heart's delight. But PHP is usually one with
Apache, and signals are not easily shared.
I suggest implementing a timeout using ticks on the C level.
- Stig
--
Stig Sæther Bakken <ssb@fast.no>
Fast Search & Transfer ASA, Trondheim, Norway