downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

http_build_str> <http_send_stream
[edit] Last updated: Fri, 25 May 2012

view this page in

http_throttle

(PECL pecl_http >= 0.10.0)

http_throttleHTTP 抑止処理

説明

void http_throttle ( float $sec [, int $bytes = 40960 ] )

throttle delay および送信バッファサイズを指定します。

注意: この関数は、 http_send_data()http_send_file() そして http_send_stream() と組み合わせて使用することを想定しています。

注意: 基本的な抑止機構を提供します。 これにより、現在のプロセスがエンティティを完全に送信できるようになるでしょう。

注意:

これは、以下の SAPI では期待通りに動作しないかもしれません。 FastCGI.

パラメータ

sec

各チャンクが送信された後に待機する秒数。

bytes

チャンクの大きさ (バイト単位)。

例1 http_throttle() の例

約 20 kbyte/秒 でファイルを送信します。

<?php
// ~ 20 kbyte/s
# http_throttle(1, 20000);
# http_throttle(0.5, 10000);
http_throttle(0.12000);
http_send_file('document.pdf');
?>

参考



add a note add a note User Contributed Notes http_throttle
dr dot sane at gmail dot com 19-Mar-2011 01:24
Note that in the example when it says "Send file with approximately 20 kbyte/s." that is only an upper bound. The file could still be sent at a lesser speed (e.g. 10 kb/s) if the client, network, or server, cannot handle the amount.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites