hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Checking if connections are stale with NIO
Date Wed, 01 Oct 2008 09:00:20 GMT
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. 

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


Mime
View raw message