FrameDecoder and cumulation size

ljohnston johnstlr at yahoo.co.uk
Tue Aug 30 12:04:47 EDT 2011


Hi Trustin

I've not seen this need in our use cases so maybe this should be pluggable?
Perhaps the FrameDecoder could track the number of bytes consumed when
decode returns non-null, and pass this value and the current buffer size
into an interface that determines the size to reset the buffers to -
something like

int resetBufferSize(int bytesConsumed, int currentBufferSize);

Netty could have a default implementation that always returned
currentBufferSize preventing the FrameDecoder from altering the current
buffer. Other scenarios could be dealt with as required.

One limitation of this approach is that it only really works if traffic is
reasonably constant. It doesn't allow for the "free buffers if not used for
while" type scenario.

Cheers
Lee

--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/FrameDecoder-and-cumulation-size-tp6596595p6742743.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list