Choosing a codec handler implementation

Christian Migowski chrismfwrd at gmail.com
Thu Aug 20 01:47:42 EDT 2009


Hi Hez,

On Thu, Aug 20, 2009 at 6:40 AM, hezjing<hezjing at gmail.com> wrote:
> Hi
> I want to encode/decode a message with a fixed length header followed by a
> payload of multiple TLVs (Tag-Length-Value).
> The header will tell the message type, as well as the total size of the
> payload.
> How do you suggest to implement this kind of codec?
> I'm thinking to have one handler that is to encode/decode the fixed length
> header, and wait for the entire payload,
> followed by another handler for the payload.
> Do you think this is right way?

That is how I would do it as well (given the information you wrote).
You could extend the LengthFieldBasedFrameDecoder for this
(decoding-)handlers.

regards,
christian!


More information about the netty-users mailing list