Jeff Genender wrote: > > > Mike Heath wrote: >> What the FAQ is saying is that the idle event wont tell you which >> request message was issued when the timeout occured. So using an idle >> read to detect an unresponsive connection is perfectly legitimate. >> >> I don't see why using idle wouldn't work for pipelining. If the session >> times out, it gets closed which would cause any pending requests to fail >> anyway. >> >> I may just be presumptuous. Am I missing something? >> > > This is pipelining...using a single connection for reuse for multiple > requests, which tells me that a sessionIdle would probably not work.
To clarify, my understanding of pipelining is that it is sending multiple requests and then waiting for the corresponding responses. This is more than HTTP keep alive which would also allow using a single connection for multiple requests but doesn't necessarily involve the batching of pipelining. > But if you are saying its possible, then great! What I'm saying is that in the AHC code at http://svn.apache.org/repos/asf/geronimo/sandbox/async-http-client-mina2, the HttpIoHandler.TimeoutTask is unaware of which request has been sent. It only knows which IoSession is being used (that's the only field in the TimeoutTask). So essentially the timeout logic as it is implemented in AHC is no different than using the MINA idle logic. Does the AHC client currently support pipelining? If I issue two pipelined requests, and the first one times out causing the session to close. How does the future of the second request get notified of the timeout? I only see code for working with CURRENT_REQUEST (from the IoSession attributes). I don't see any code for dealing with pending requests. -Mike BTW - Thanks for the discussion, Jeff. It's really helped me to go back and look deeper in the AHC code. -Mike