You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Trustin Lee <tr...@gmail.com> on 2007/12/07 03:42:17 UTC

Splitting TextLine codec and PrefixedString codec into two layers

Hi,

As you know, MINA 2.0 allows you to stack multiple protocol codec
filters to help you implement multi-layered protocols.

Yesterday, Maarten added PrefixedString codec which is similar to
TextLine codec.  During talking to David Lloyd, I realized that the
only difference between them is just in how they frame packets.  The
part that reads a string doesn't differ at all.  Therefore, it might
be a good idea to reorganize these codecs into the following layout:

+--------------------------------------------------------------------+
|                             String codec                           |
+-----------------------------------+--------------------------------+
| Delimiter-based msg framing codec | Length-based msg framing codec |
+-----------------------------------+--------------------------------+

The advantage of this redesign is that users who doesn't need String
conversion still can get help of the message framing codecs.  WDYT?

Trustin
-- 
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6

Re: Splitting TextLine codec and PrefixedString codec into two layers

Posted by Mark <el...@gmail.com>.
sounds good to me...  +1


On Dec 6, 2007 9:42 PM, Trustin Lee <tr...@gmail.com> wrote:

> Hi,
>
> As you know, MINA 2.0 allows you to stack multiple protocol codec
> filters to help you implement multi-layered protocols.
>
> Yesterday, Maarten added PrefixedString codec which is similar to
> TextLine codec.  During talking to David Lloyd, I realized that the
> only difference between them is just in how they frame packets.  The
> part that reads a string doesn't differ at all.  Therefore, it might
> be a good idea to reorganize these codecs into the following layout:
>
> +--------------------------------------------------------------------+
> |                             String codec                           |
> +-----------------------------------+--------------------------------+
> | Delimiter-based msg framing codec | Length-based msg framing codec |
> +-----------------------------------+--------------------------------+
>
> The advantage of this redesign is that users who doesn't need String
> conversion still can get help of the message framing codecs.  WDYT?
>
> Trustin
> --
> what we call human nature is actually human habit
> --
> http://gleamynode.net/
> --
> PGP Key ID: 0x0255ECA6
>



-- 
--------------------------------
The adjuration to be "normal" seems shockingly repellent to me; I see
neither hope nor comfort in sinking to that low level. I think it is
ignorance that makes people think of abnormality only with horror and allows
them to remain undismayed at the proximity of "normal" to average and
mediocre. For surely anyone who achieves anything is, essentially, abnormal.
    Dr. Karl Menninger