views:

20

answers:

1

I would like to send multiple HTTP requests to a server, using pipelining where possible, and otherwise using multiple TCP connections. However, HttpWebRequest seems to automatically use multiple connections if ServicePointManager.DefaultConnectionLimit is bigger than 1. I can only get it to pipeline if I set this to 1. Is there an alternative way to force pipelining?

+1  A: 

There is no way to force pipelining using HttpWebRequest. However, if the server is 1.1 compliant,and your request method is Idempotent,you can get a high probability of pipelining being used if you use async and issue multiple requests to the same server at a time. You can also use synchronous pattern with multiple threads. The key is to issue more than one request at a time.

feroze
Thanks for the confirmation. Synchronous isn't that great for scalability, but I guess that the performance i'm getting with asynch is good enough.
evilfred