Re: HTTP_Request2, keep-alive and re-using request objects
| From: | Christian Weiske | Date: | Fri, 02 Sep 2016 08:52:55 +0000 |
| Subject: | Re: HTTP_Request2, keep-alive and re-using request objects | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-32156@lists.php.net to get a copy of this message | ||
Hi Christian,
HTTP_Request2 supports keep-alive in HTTP requests. The question is now how to use it. The following naive code does not use it: <?php $req1 = new HTTP_Request2('http://example.org/1.htm'); $res1 = $req1->send(); $req2 = new HTTP_Request2('http://example.org/1.htm'); $res2 = $req2->send(); ?>The code *does* indeed use it. In the socket adapter, the connection list is static and thus automatically shared. -- Regards/Mit freundlichen Grüßen Christian Weiske -=≡ Geeking around in the name of science since 1982 ≡=-