I have some code like, this code is used very heavily:
using (HttpWebResponse r = _GetHttpWebResponse(uri, body, method, contentType, headers)) {
/* do something with the response */
/* call r.Close() explicitly? */
}
The code works fine today, but the connections to the server stay open for quite some time. (checked using TCPView)
Is there a benefit to calling the Close()
method explicitly? Is it recommended, or maybe recommended not to do it, and why?