You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Vibhav Sharma <vi...@drishti-soft.com> on 2006/07/24 15:36:30 UTC

open ended Http connection

Hello all,

I need to have an open connection to the server, i.e. send some data ->  
receive some data -> send some data and so on ... till I explicitly 
close the connection. Basically open streams both way.

Is there any way to do this with the current implementation of 
httpclient. As I see it, at 'httpClient.execute(method)', the request 
part is sent once and for all.

The response is ok with getResponseBodyAsStream(), but what if I have to 
send more data as part of the request  *after* receiving a part of the 
response.

If somebody has any idea, could you please share it?

Thanks,
Vibhav

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org


Re: open ended Http connection

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2006-07-24 at 19:06 +0530, Vibhav Sharma wrote:
> Hello all,
> 
> I need to have an open connection to the server, i.e. send some data ->  
> receive some data -> send some data and so on ... till I explicitly 
> close the connection. Basically open streams both way.
> 
> Is there any way to do this with the current implementation of 
> httpclient. As I see it, at 'httpClient.execute(method)', the request 
> part is sent once and for all.
> 
> The response is ok with getResponseBodyAsStream(), but what if I have to 
> send more data as part of the request  *after* receiving a part of the 
> response.
> 
> If somebody has any idea, could you please share it?
> 

Vibhav,

Even though it should be possible to stream data in and out in full
duplex using chunk coding with HTTP/1.1, not many web servers support
this mode well, as the HTTP protocol has been designed around the
request/response communication paradigm. Presently HttpClient does not
support content streaming in full duplex. We might add this
functionality to HttpComponents (aka HttpClient 4.0) if there's a
significant popular demand for it.

Oleg

> Thanks,
> Vibhav
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org