Ensure full response received with http keep-alive connection

pvshewale pvshewale at gmail.com
Tue May 24 08:03:45 EDT 2011


Hi,

   I am fairly new to Netty and started using it recently. First of all
thanks for sharing such a nice work.

   I have written HTTP client based on Netty which sends requests with
keep-alive connection. The purpose is to send next http request on same
channel once first response is fully received. So query is on how to ensure
that response for my http request is fully received and then proceed with
next request. I want to send http requests serially on open channel and
decide to send next request or not based on what http response received for
first request.

Then another question if how to get http response object, in client thread
thats sends the request. Now I am getting response object in handler with
messageReceived() method. I need transfer that object to main thread where
client sends request. can you please let me know how I can achieve this?

Just to simplify, my work flow in main thread will be as below,
1. open channel and connect to remote server
2. create http request with keep-alive header
3. write http request over the channel
4. wait till full response or error is received (I need help over here)
5. get response object (I need help over here)
6. use same channel and write next request

Thanks,
Prashant



  

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Ensure-full-response-received-with-http-keep-alive-connection-tp6398247p6398247.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list