Hi Uday,
On 3/21/07, Uday Prakash (DHL CZ) <[EMAIL PROTECTED]> wrote:
Hi Trustin,
Is there a way to set up the framework so that when a message stream is
received and messageReceived(...) is called we are able to extract
individual messages from a stream of messages.
Say, the messages start with <STX> and end with <ETX> so when we get a
stream of bytes the messageReceived(...) method is called and only that
part of the stream between <STX> and <ETX> comes in as a message object.
Sure. MINA provides ProtocolCodecFilter, which decodes the incoming
ByteBuffers into your favorite plain old Java object. Please refer to
a few examples which uses a protocol codec; SumUp, and Reverse Echo.
It will take you some time to understand how to implement your codec.
Please try to review our decoder and encoder implementations, and feel
free to ask questions here. The following decoder classes could be
helpful for you.
* TextLineDecoder - http://tinyurl.com/37csqo
* ObjectSerializationDecoder - http://tinyurl.com/389ymp
And thank you for that precious hint, I was able to get the Threads to
die elegantly!
Good to hear that! :)
HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP Key ID: 0x0255ECA6