On 10 June 2009 12:33, Oleg Kalnichevski <[email protected]> wrote: > On Wed, Jun 10, 2009 at 01:54:16PM +0200, Pasquiers Gwenhael wrote: > > Thanks for your help, it works; > > > > But (there's alway a but) I can't make it behave like http/1.1 allows; I > mean I can't send a second request until I receive the first answer; I seems > to be synchronous at protocol level (http/1.0). > > > > I have to do > > > > > > client server > > --- req 1 --> > > <-- resp 1 -- > > --- req 2 --> > > <-- resp 2 -- > > > > Where I'd like to do : > > > > client server > > --- req 1 --> > > --- req 2 --> > > <-- resp 1 -- > > <-- resp 2 -- > > > > > > Is there some way around it ? > > > > I guess what you are saying is that you would like to pipeline requests? > The > trouble with pipelining is that should only be used with idempotent > requests > such as GET and HEAD [1]. Moreover pipelining is simply incompatible with > the > 'expect-continue' handshaking. HttpCore NIO is fully pipelining capable, as > its > non-blocking HTTP connections can work in the full duplex mode (they > maintain > separate conversation states for input and output operations). The standard > protocol handlers can't do pipelining due to their support for the > 'expect-continue' handshaking. You can provide a custom NHttpClientHandler > implementation that supports pipelining of requests instead. Do not expect > it > to be easy, though. > > Overall, I personally think the request pipelining is not worth the > trouble. > > Nudge.
FYI, I have a use case where pipelining might be a very nice feature to have. On mobile, establishing a connection is very slow. You really want to use persistent connections and maybe pipelining to batch up data requests. If I was doing any Android development, I'd probably be quite motivated to put some work into developing that as a feature. But I'm not! Cheers, James > Hope this helps > > Oleg > > [1] http://www.mozilla.org/projects/netlib/http/pipelining-faq.html > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
