|
Posted by Janwillem Borleffs on 11/14/05 00:34
Lisa Pearlson wrote:
> So I want a 'blocking' read operation, but one that doesn't block
> forever, but times out.
> I know how many bytes I expect when doing a read operation, so
> perferably I tell the read operation how many bytes to read.. if it
> is not received within x seconds, it should time out.
>
> How can this be done in PHP?
>
With PHP v > 4.3, you should be able to use stream_set_timeout for this:
http://www.php.net/stream_set_timeout
JW
Navigation:
[Reply to this message]
|