HttpResponseDecoder buffering data
halfempty
gnell69 at hotmail.com
Thu Jul 8 17:23:00 EDT 2010
Hi, I'm writing a client for a web server that I do not control. The web
server allows "subscribing" to a URL, eg, make a GET request to a URL. The
connection stays open, no content-length is sent down, and data is
transmitted to the client in a frame format. As the client I would like to
decode the frames immediately, as they are received over the wire. The time
between frames could be minutes or longer.
Currently I've implemented a pipeline which contains a HttpResponseDecoder,
followed by my own FrameDecoder (an extension to
SimpleChannelUpstreamHandler).
Everything works well except that it appears that my FrameDecoder's
messageReceived() function is called only when the buffer of the
HttpResponseDecoder above it is full. In other words, the FrameDecoder does
not get a chance to decode frames until enough have been transmitted to fill
the HttpResponseDecoder buffer.
As such, the only way I can force my FrameDecoder to be called immediately
when data is available is to set the maxChunkSize of the HttpResponseDecoder
to 1 byte. This succeeds in allowing me to decode data as soon as it
arrives, but is clearly not efficient.
I can't figure out another way to get the HttpResponseDecoder to immediately
pass data further down the pipeline. Is there anything I'm missing?
Thanks!
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/HttpResponseDecoder-buffering-data-tp5272020p5272020.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list