hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Jack" <aj...@TrySybase.com>
Subject RE: [PATCH] Re: java.net.SocketException
Date Wed, 18 Dec 2002 23:00:01 GMT

I'm no patch expert (and couldn't get my MKS patch.exe to process your file)
so I manually did this (see below).

The patch works. In fact I'd already changed my code to retry on
java.net.SocketException as I do on an HttpRecoverableException, so there
was really little difference. That said, it seems somewhat disappointing for
the user code to have to participate in this recovery. I know I am broken
recrod that HttpClient is too low level but wouldn't it be saving disk space
accross the world to put a configurable set of retries in for this and save
this code going into all clients? Just my tuppence.

Thanks for your input, and your previous posting repost (interesting).



P.S. I use a VPN over a modem, nothing fast about my link, so I am not sure
our scenarios can be the same, if yours was affected by a log entry.


 protected void readResponse(HttpState state, HttpConnection conn)
 throws HttpException {
         "enter HttpMethodBase.readResponse(HttpState, HttpConnection)");
     readStatusLine(state, conn);
     processStatusLine(state, conn);
     readResponseHeaders(state, conn);
     processResponseHeaders(state, conn);
     readResponseBody(state, conn);
     processResponseBody(state, conn);
     } catch(IOException e) {
         throw new HttpRecoverableException(e.toString());

-----Original Message-----
From: Ortwin Gluck [mailto:ortwin.glueck@nose.ch]
Sent: Wednesday, December 18, 2002 1:45 PM
To: Commons HttpClient Project
Subject: [PATCH] Re: java.net.SocketException

Maybe we should change readResponse to catch IOException and rethrow it
as a HttpRecoverableException? --> See patch

Please try if this fixes your problem.


Ps. Would like a test case for this one though.

Adam Jack wrote:
  > java.net.SocketException
> [java.net.SocketException: Connection reset by peer: JVM_recv in socket
> input stream read] (java.net.SocketException)java.net.SocketException:
> Connection reset by peer: JVM_recv in socket input stream read at
> java.net.SocketInputStream.socketRead0(Native Method) at
> java.net.SocketInputStream.read(SocketInputStream.java:116) at
> java.net.SocketInputStream.read(SocketInputStream.java:144) at
> 4) at
> ava:1843) at
> a:1608) at
> ava:2266) at
> ) at
> at org.apache.commons.httpclient.HttpClient.executeMethod

View raw message