hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Litty Preeth <preeth.h...@gmail.com>
Subject Re: ConnectTimeoutException after 5 to 6 hrs
Date Tue, 25 Oct 2011 09:07:03 GMT
I posted the same issue on stackoverflow:
http://stackoverflow.com/questions/7723558/apache-httpclient-giving-connection-timeout-after-5-ot-6-hrs

Someone suggested that I these issue comes if the response is not fully
emptied. Also if I enable the wire and header debug for httpclient, I am not
getting this issue. So may be the root cause is because the response is not
fully drained. I tried the following for every request:

int statusCode = res.getStatusLine().getStatusCode();
String reasonPhrase = res.getStatusLine().getReasonPhrase();
Header[] headers = res.getAllHeaders();
HashMap<String, String> headerMap = new HashMap<String, String>();
if (headers != null) {
    for (Header header : headers) {
        if (header != null) {
            headerMap.put(header.getName(), header.getValue());
        }
    }
}
HttpEntity resEntity = res.getEntity();
if (resEntity != null && resEntity.getContentLength() > 0) {
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    resEntity.writeTo(os);
    resStr = os.toString();
}

But I am still getting the issue if I don't turn on debug logging. So can
anybody suggest how to empty a response?

Regards,
Litty Preeth

On Thu, Oct 20, 2011 at 1:47 AM, Vasile Alin <alinachegalati@gmail.com>wrote:

> On 18 October 2011 08:05, Litty <preeth.here@gmail.com> wrote:
>
> > I am able to connect to the same URL from the same machine using a
> browser.
> > So I don't think the issue is with web server.
> >
>
> This doesn't prove that there are no issues with the web server.
>
> ---------------------------------------------------------------------
> 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