hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jammy Chen <jamm...@gmail.com>
Subject Re: HttpPost object needs to be explicitly released?
Date Mon, 31 Aug 2015 15:18:52 GMT
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 <olegk@apache.org>:

> 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: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message