Quintin Beukes wrote:
Will NIO connections work?


Yep. NIO is event driven, so the I/O selector will trigger an event if a channel gets closed by the other side

Oleg

PS: I'm off to bed. Wife is angry.

On 6/21/08, Quintin Beukes <[EMAIL PROTECTED]> wrote:
Hey,

So.. keepalive is sort of useless then? Because I realised what my problem
is. It wasn't synchronization. It was because connections closed by the
server, and then it fails when I try to re-use the connection.

Basically what I have is this:
I try once, if receiving a NoResponse exception, I remove it from the pool
and try again
If second try fails as well, it gets removed and I try again but with an
isStale() check first.

My problem is that these keep failing until I filtered through all
connections in the pool. In which case I start making new ones.

How does HttpClient handle this? Or what can I do to improve this into
being more reliable (in the sense of reducing failures to a minimum).

Q

On 6/21/08, Oleg Kalnichevski <[EMAIL PROTECTED]> wrote:
Quintin Beukes wrote:

Hey,

Isn't isStale() supposed to be able to tell me whether the server is
accepting responses?


No, it is intended to test if the connection is still valid on the client
side. Blocking I/O provides no good means of telling if the socket has been
closed by the peer. #isStale is a work-around for the problem.

Oleg

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Quintin Beukes






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to