Re: Timeout Function
| From: | Rasmus Lerdorf | Date: | Tue, 24 Apr 2001 22:14:59 +0000 |
| Subject: | Re: Timeout Function | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-52326@lists.php.net to get a copy of this message | ||
> > Right, but when you are doing network work like this you should be using
> > fsockopen() directly which does have timeout support. readfile() with a
> > url argument just does a simple fsockopen anyway and issues a GET request.
> > Trivial to do yourself using fsockopen() and fputs() and this way you can
> > manage the timeouts yourself. Introducing a language-level timeout
> > feature is complicated.
>
> I want to *write* to the connection to do a GET request? That sort of makes
> sense, but how do I get what the remote server returned after I issued the
> request?
fputs() to write and fgets() to read. Type "PostToHost" into Google or
something and you should turn up a function I wrote years ago that does
something like this. It does a POST request which is a bit more complex.
-Rasmus