On Wed, Jan 14, 2009 at 8:21 PM, Andy Ruch <[email protected]> wrote: > I've recently upgraded to Mina-2.0.0-M4 from M3 and have a question > about the CumulativeProtocolDecoder. I'm transfering messages that > contain a byte payload over TCP at high speed. > > Is it > recommended to copy the data out of the buffer into another buffer or > can I just use the buffer that is given to me? I was trying to use the > same buffer but I seem to experience a loop in the data I receive. I've > tracked it down to the ProtocolCodecFilter. When the buffer is returned > from the Cumulative decoder, the position is equal to the limit. > However, after the rest of the filters are executed, the buffer > position is back to 0. This causes the cumulative decoder to send me > the same data I just processed. This was never a problem with Milestone > 3. I know a zero-copy solution has better performance. What is the > recommended use that has the best performance?
I just ran the XML Decoder code that I wrote for M3 code, and it worked fine. Can you post the code snippet and possibly your filter chain configuration as well. Ensure to reset the position in IoBuffer, while returning false from CumulativeDecoder -ashish
