Thanks Oleg. What you said is we do NOT need call httpPost.releaseConnection() and httpPost.close(), right? if yes, when the HTTP connection will be released properly? if I do release, do it have negative impact?
What is the propose of the API httpPost.releaseConnection()? Jammy 2015-08-31 23:12 GMT+08:00 Oleg Kalnichevski <[email protected]>: > On Mon, 2015-08-31 at 22:54 +0800, Jammy Chen wrote: > > Hi, > > > > Do I need explicitly release HttpPost object? > > > > No, you do not. > > Oleg > > > I am using HttpClient 4.3.6 in multiple-thread environment, I read the > > guide from > > > http://hc.apache.org/httpcomponents-client-4.3.x/tutorial/html/fundamentals.html#d5e74 > , > > but it does not indicates we need call httpPost.releaseConnection() or > > httpPost.close(). > > > > I know we should consume the HTTP response stream, close the stream, > close > > the response and also close the HTTP client instance, from the guide > above, > > it mentioned calling httpResponse.close() it will shutdown the http > > connections already. > > > > I am now having problem multiple-thread environment, after using > > httpPost.releaseConnection() it works fine, but I am really concerned > about > > whether we need use it, from the the API doc of > > httpPost.releaseConnection(), it says only for convenient http client 3 > > API. > > > > If it is needed, where should be? after closing HTTP response or before > > closing HTTP response. > > > > Thanks for your help > > > > Jammy > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
