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
Last updated: Fri, 14 Aug 2009

view this page in

http_throttle

(PECL pecl_http >= 0.10.0)

http_throttleÉtranglement HTTP

Description

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

Définit le délai d'étranglement et envoie la taille du buffer.

Note: Cette fonction doit être utilisée avec les fonctions http_send_data(), http_send_file() et http_send_stream().

Note: Fournit un mécanisme d'étranglement, qui gèrera le processus courant tant que l'entité n'aura pas été complètement envoyé.

Note: Ne fonctionnera pas comme prévu avec les SAPIs suivants : FastCGI.

Liste de paramètres

sec

secondes à attendre après chaque partie envoyée

bytes

la taille d'une partie en octets

Exemples

Exemple #1 Exemple avec http_throttle()

Envoi un fichier à une vitesse approximative de 20 ko/s.

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

Voir aussi



add a note add a note User Contributed Notes
http_throttle
There are no user contributed notes for this page.

http_build_str> <http_send_stream
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites