As the title says I'd like to disable the pipelining functionality BUT still make use of the connection pool (so KeepAlive=False is not an option). The reason is that longer requests may prevent shorter requests from executing fast, but opening up a new connection for every requests is significantly slower.
I'm doing this:
_webRequestHandler = new WebRequestHandler();
_webRequestHandler.AllowPipelining = false;
_httpClient = new HttpClient(_webRequestHandler);
await _httpClient.SendAsync(request);
servicePoint = ServicePointManager.FindServicePoint(request.RequestUri);
This seems to have no effect: The ServicePoint.SupportsPipelining property is still true and the WebRequestHandler is only setting the Pipelined property of the HttpWebRequest but nothing on the HttpRequestMessage so basically setting AllowPipelining on the WebRequestHandler has no effect (?).
Am I missing something here? I'm sure this is a common scenario - how can I achieve that?