opensubscriber
   Find in this group all groups
 
Unknown more information…

d : dev@hc.apache.org 10 June 2009 • 8:33PM -0400

Re: Re: [NIO HttpCore user] sending requests
by Oleg Kalnichevski

REPLY TO AUTHOR
 
REPLY TO GROUP




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.

Hope this helps

Oleg

[1] http://www.mozilla.org/projects/netlib/http/pipelining-faq.html

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

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

Bookmark with:

Delicious   Digg   reddit   Facebook   StumbleUpon

Related Messages

opensubscriber is not affiliated with the authors of this message nor responsible for its content.