hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carl A. Dunham" <c...@carldunham.com>
Subject Re: Still problems with HttpRecoverableException and HTTPS
Date Mon, 14 Apr 2003 15:59:12 GMT
This is really bugging me, because I know this is a well-known problem in 
Java. Unfortunately, Google doesn't seem to have much to offer, other than 
people asking the same question in different contexts.

I did, however, find this:


with the suggestion to use InputStream.available() to test if the connection 
is still valid. If someone has a reliable test case, maybe this is something 
to try.

SO_KEEPALIVE may also be helpful here.

On Monday April 14 2003 11:18, Michael Becke wrote:
> Yes, our choices for connection testing, that involve hitting the
> server, are HEAD, OPTIONS and TRACE I believe.  I think OPTIONS and
> TRACE are best from a functionality perspective, but they only exist in
> HTTP 1.1.  I do not know if HEAD has any side effects and what it would
> do for a URL meant for POSTs (a METHOD_NOT_ALLOWED status perhaps). I
> think the big question here is when would we want to do this?
> Another random thought.  Would doing a out.flush() at the end of a
> request cause an exception when the socket is closed?
> Mike
> Mike Moran wrote:
> > Ortwin Gl├╝ck wrote:
> >> Michael Becke wrote:
> >>> The obvious best solution would be to figure out a way to determine
> >>> if a connection has been closed by the server.
> >>
> >> The only way to do this, is to perform read / write on the connection,
> >> which is sad.
> >
> > Wouldn't it be possible to send an OPTIONS[1] request just before you
> > send the real request? As this doesn't really do anything it should be
> > harmless semantically, and should cause an exception if the socket is
> > buggered. Obviously it's an extra overhead on each request but perhaps
> > it could be optionally or heuristically enabled?
> >
> > [1]: http://rfc.net/rfc2616.html#p52
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> commons-httpclient-dev-unsubscribe@jakarta.apache.org For additional
> commands, e-mail: commons-httpclient-dev-help@jakarta.apache.org

View raw message