directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trustin Lee <trus...@gmail.com>
Subject Re: Protocol decoder for vm pipe session
Date Mon, 17 Oct 2005 16:42:27 GMT
Hi Paolo,

2005/10/18, Paolo Perrucci <p.perrucci@ludonet.it>:
>
> I understand that encoding/decoding can be optional but I think that in
> some cases they can help to simplify the code.
> For example, in the last days I developed a tcp server (using
> ProtocolHandler) that read ReadMessage objects and write WriteMessage
> objects.
> Hence I wrote a TcpProtocolEncoder that trasform WriteMessage to
> ByteBuffer and a TcpProtocolDecoder that trasform ByteBuffer to
> ReadMessage.
> Now I would like to add the vm pipe transport type support to the same
> server but because I can't use encoding/decoding, MINA call
> ProtocolHandler.messageReceived() with a message of type WriteMessage.
> So when receiving messages from a vm pipe client the messageReceived()
> should first trasform the WriteMessage in a ReadMessage.
> Hence the messageReceived() code depends on the session trasport type.
>
> My question is: is there a design flaw in my project or I missed
> something in the use of vm pipe trasport type?
>

You don't need to use any codec to transform WriteMessage into ReadMessage.
It's just a bean-to-bean conversion. I don't see any encoder or decoder
involving in this process.

Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/

Mime
View raw message