Confuse about LengthFieldBasedFrameDecoder
Christian Migowski
chrismfwrd at gmail.com
Wed May 25 01:17:43 EDT 2011
Hi,
I use (and I think that is the way it should be used)
LengthFieldBasedFrameDecoder as it is, without modifications, as the
first handler in the pipeline for many projects. If you have a network
message format that contains a length field to determine the message
boundaries, use this and add other handlers later in your pipeline to
decode the correctly framed received content into POJOs without having
to worry that the message is not completely received yet.
Of course, you can do this alltogether in one handler and leave the
LFBFD out, it is your choice.
regards,
christian!
On Wed, May 25, 2011 at 4:58 AM, magiceye <magiceye at 163.com> wrote:
> I have read LengthFieldBasedFrameDecoder doc, but I can't understand what is
> the difference of implementing the decode method between its base
> FrameDecoder.
> The only difference I can figure out is that when I set initialBytesToStrip
> to nonzero value, the decode method parameter buffer will not contain the
> stripped data.
> But what about others parameter? lengthFieldOffset, lengthFieldLength,
> lengthAdjustment those 3 parameter's setting seems can not affect the decode
> method compare to extends a FrameDecoder.
>
> So my question is: What things can LengthFieldBasedFrameDecoder help me to
> do in writing decode method compare with extends from FrameDecoder? Or these
> parameter just use to validate data received?
>
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Confuse-about-LengthFieldBasedFrameDecoder-tp6401217p6401217.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
>
More information about the netty-users
mailing list