Does C++ REST SDK support HTTP Pipelining to make single connection for multiple requests.

May 16, 2013 at 1:28 PM

I can see http_pipelining class in C++ REST SDK. But this one is for adding intermediate stage to your request.

Is there be anything like given in following url:

i.e making single connection and sending multiple requests to server and responses are coming in the order of requests send.

Please update

May 16, 2013 at 3:19 PM
Edited May 16, 2013 at 3:23 PM
It depends on the OS. On Windows 7, Windows Server, and Windows 8 desktop, we're using WinHTTP and have control over the connections. Each http_client instance will have its own connection. On the other hand, for WIndows 8 app store apps, the connection control is done by the underlying HTTP stack, surfaced through the IXmlHttpRequest2 COM object.

This means that we can control (and support) pipelining in the first case, but I'm not sure what happens in the second case. You shouldn't have to do anything special in order to get pipelining to work, just send out requests and wait for the responses asynchronously (using .then()). Please note that a server may decide not to cooperate and refuse to start processing a second request before sending out the reply to the first, which makes pipelining less useful, but at least the client should be able to do its part here.

On Linux, we also have control over the connections, by the way.