Re: is there keep-alive support in HTTP_Request2?
| From: | Marc Vaillant | Date: | Tue, 25 Nov 2008 19:06:21 +0000 |
| Subject: | Re: is there keep-alive support in HTTP_Request2? | ||
| References: | 1 2 3 4 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-51154@lists.php.net to get a copy of this message | ||
On Tue, Nov 25, 2008 at 02:03:13AM +0300, Alexey Borzov wrote:
> Hi Marc,
>
> Marc Vaillant wrote:
>>> I only see a single HTTP request being done in your attached example,
>>> so the above doesn't quite apply to it. You'll have to clarify what
>>> you and your server mean by "keep-alive support".
>>
>> It's a single request to the server and the server sends multiple
>> responses. Also attached is a socket based client with response output.
>> The connection it creates doesn't get dropped.
>
> The stuff your server is sending is *not* HTTP responses, but HTTP requests!
>
> POST / HTTP/1.1
> Host:
> User-Agent: gSOAP/2.7
>
> definitely doesn't look like a response to me. Dunno how exactly one
> should work with that server, but HTTP_Request2's scope is sending
> requests and parsing responses, not vice-versa...
What should proper responses look like? I want to send a single request
and get multiple responses over the same connection. How would I
simulate this properly server side in php? Something like the following
doesn't work for me:
<?php
ob_start();
echo 1;
header("Connection: keep-alive");
header("Content-Length: 1");
ob_end_flush();
flush();
ob_start();
echo 2;
header("Connection: keep-alive");
header("Content-Length: 1");
ob_end_flush();
?>
Thanks,
Marc