J
Jules Winfield
Dear Friend,
My WPF client application makes use of a proprietary HTTP-based API via the
WebClient class. It needs to make a large number of calls to this API. Each
call must be made in succession. At no time is more than one call being made
at the same time. Each call instantiates a *new* WebClient object and calls
the appropriate methods to obtain the response from the HTTP server.
My question is: How many connections are being made to the server "under the
hood?" Is a separate connection being established for each call (that is,
each new instantiation of WebClient) and then being shut down after the
response is received? Or alternatively, is a single connection being
established, kept alive, and then reused for each call? I'd certainly prefer
the latter. The number of calls to the API will be so large that
establishing a new TCP/IP HTTP connection for each call would seem to be an
inefficient use of resources.
Jules
My WPF client application makes use of a proprietary HTTP-based API via the
WebClient class. It needs to make a large number of calls to this API. Each
call must be made in succession. At no time is more than one call being made
at the same time. Each call instantiates a *new* WebClient object and calls
the appropriate methods to obtain the response from the HTTP server.
My question is: How many connections are being made to the server "under the
hood?" Is a separate connection being established for each call (that is,
each new instantiation of WebClient) and then being shut down after the
response is received? Or alternatively, is a single connection being
established, kept alive, and then reused for each call? I'd certainly prefer
the latter. The number of calls to the API will be so large that
establishing a new TCP/IP HTTP connection for each call would seem to be an
inefficient use of resources.
Jules