Apache Directory Project - RE: [MINA] Protocol decoder for vm pipe session

This is Interesting: Free IT Magazines  
Home > Archive > Apache Directory Project > October 2005 > RE: [MINA] Protocol decoder for vm pipe session





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author RE: [MINA] Protocol decoder for vm pipe session
Jose Alberto Fernandez

2005-10-19, 5:46 pm

> From: Paolo Perrucci [mailto:p.perrucci-rA2pRtUFECGonA0d6jMUrA@public.gmane.org]
>=20
> 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.
>=20
> My question is: is there a design flaw in my project or I missed
> something in the use of vm pipe trasport type?
>=20


I do not know about design flaws. :-)

But remember that you need to bind your server to the VM_PIPE,
separately
The protocol handler that you use for that binding may be the right
place to perform your bean2bean conversion (if you want to reuse the
other code).

Remember, VM_PIPE do not use buffers or char arrays, hence
encoders/decoders make no sense. You do not have the right objects.

Jose

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com