0

Http 1.1 uses persistent connections as it has advantage of sending multiple http request using same connection. My concern is with the below guideline:

You must call the Close method to close the stream and release the connection. Failure to do so may cause your application to run out of connections.

Why should I close the stream or connection after receiving response, if same connection is used for multiple httprequest? I am triggering multiple httprequests for same internet resource so why should I close connection/stream/response each time I receive a response?

  • What is the source of this guideline? Any API or programing language? – home Sep 02 '13 at 18:11
  • More context would be helpful, but I believe that guideline is referring to closing the stream AFTER all the resources have been requested and received. This is sometimes achieved with a timeout (e.g. close the stream after 3 seconds with no new requests). – pieman72 Sep 02 '13 at 20:46
  • How does this relate to http://stackoverflow.com/questions/18477975/servicepoint-httpconnectionhttp-1-1-httppipelining-responons-stream-close-inter ? – home Sep 03 '13 at 17:05

0 Answers0