6 skipif(!http_support(HTTP_SUPPORT_REQUESTS), "need request support");
9 http.persistent.handles.limit=-1
10 http.persistent.handles.ident=GLOBAL
15 echo "No free handles!\n";
16 foreach (http_persistent_handles_count() as $provider => $idents) {
17 foreach ((array)$idents as $ident => $counts) {
18 if (!empty($counts["free"])) {
19 printf("%s, %s, %s\n", $provider, $ident, $counts["free"]);
24 http_get("http://www.google.com/", null, $info[]);
26 echo "One free request handle within GLOBAL: ";
27 var_dump(http_persistent_handles_count()->http_request["GLOBAL"]["free"]);
29 echo "Reusing request handle: ";
30 http_get("http://www.google.com/", null, $info[]);
31 var_dump($info[0]["pretransfer_time"] > 10 * $info[1]["pretransfer_time"], $info[0]["pretransfer_time"], $info[1]["pretransfer_time"]);
33 echo "Handles' been cleaned up:\n";
34 http_persistent_handles_clean();
35 print_r(http_persistent_handles_count());
42 One free request handle within GLOBAL: int(1)
43 Reusing request handle: bool(true)
46 Handles' been cleaned up:
49 [http_request] => Array
59 [http_request_datashare] => Array
69 [http_request_datashare_lock] => Array
79 [http_request_pool] => Array