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, 23 Mar 2012

view this page in

http_throttle

(PECL pecl_http >= 0.10.0)

http_throttleHTTP band genişliğini kısar

Açıklama

void http_throttle ([ float $saniye [, int $tampon_boyu = 40960 ]] )

Kısma gecikmesini ve gönderim tamponunun boyunu ayarlar.

Bilginize: Bu işlev, http_send_data(), http_send_file() ve http_send_stream() işlevleri ile birlikte kullanılmalıdır.

Bilginize: Öğe tamamen gönderilinceye kadar o anki süreç veya evrenin boyun eğeceği temel bir kısma mekanizması sağlar.

Bilginize:

Şu SAPI('ler) ile beklendiği gibi çalışmayabilir: FastCGI.

Değiştirgeler

saniye

Her parça gönderilmeden önce beklenecek süre.

tampon_boyu

Bayt cinsinden parça uzunluğu.

Örnekler

Örnek 1 - http_throttle() örneği

Dosyayı 20 kbyte/s hızla göndermek için:

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

Ayrıca Bakınız



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