hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <seb...@gmail.com>
Subject Re: Checking if connections are stale with NIO
Date Wed, 01 Oct 2008 12:26:37 GMT
On 01/10/2008, Oleg Kalnichevski <olegk@apache.org> wrote:
> On Tue, Sep 30, 2008 at 12:46:54PM +0530, Asankha C. Perera wrote:
>  > When using keep-alive connections, Apache Synapse needs to ensure that a
>  > connection is not just about to be closed after the expiration of the
>  > socket timeout. The HttpConnection.isStale() tells of the expensive -
>  > but guaranteed way to make sure of this, by making a blocking call on
>  > the socket. However, this is not possible when we are non-blocking, and
>  > the NHttpConnectionBase does not do this full check.
>  >
>  > Is this something that I have missed, or is this something we still have
>  > to implement?
>  >
>  > thanks
>  > asankha
>  >
>
>
> Hi Asankha
>
>  HttpConnection#isStale() is only applicable to blocking connections, as
>  in the blocking I/O model there is no way to test if a socket is still
>  valid on both sides other than performing a read operation on that
>  socket. #isStale() is basically meaningless for NIO connections. I very
>  much regret not having moved the method to a blocking I/O specific
>  interface.
>

Perhaps override it in NIO to throw an IllegalOperation exception?

>  Oleg
>
>
>
>  > ---------------------------------------------------------------------
>  > To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  > For additional commands, e-mail: dev-help@hc.apache.org
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
>  For additional commands, e-mail: dev-help@hc.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


Mime
View raw message