Dynamic Web Pages: deutschsprachiger PHP Knotenpunkt seit 1999

Dynamic Web Pages : deutschsprachiges PHP-Handbuch : http-throttle _

 
  PHP Journal  
  _  
 
<http_send_stream http_build_str>
Letzte Aktualisierung: Tue, 21 Oct 2014
 

http_throttle

(PECL)

http_throttle -- HTTP throttling

Beschreibung

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

Sets the throttle delay and send buffer size for use with http_send() API. Provides a basic throttling mechanism, which will yield the current process resp. thread until the entity has been completely sent, though.

Parameter Liste

sec

seconds to sleep after each chunk sent

bytes

the chunk size in bytes

Beispiele

Beispiel 1. A http_throttle() example

Send file with approximately 20 kbyte/s.

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



<http_send_stream http_build_str>
Letzte Aktualisierung: Tue, 21 Oct 2014
 


powered by Hetzner
top Alle Rechte vorbehalten. © Dynamic Web Pages 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 top

Werbung an/aus Werbung aus Werbung an