Le 11/26/12 10:44 AM, Jens Reimann a écrit : > Hallo, > > Well I don't think the way it is stored is irrelevant. > > I try to explain again. I have a filter chain like this: > > 1.) TCP > 2.) ProtocolCodecFilter with ProtocolCodecA ( Transforming IoBuffers > to MessageA ) > 3.) SomeFilter ( Doing stuff and extracting IoBuffers from some types > of MessageA) > 4.) ProtocolCodecFilter with ProtocolCodecB (Transforming IoBuffers to > MessageB ) > 5.) IoHandler > > Now since the ProtocolCodecFilter from 2 and 4 access the same > IoSession attributes, the use the same output object of the > ProtocolCodecFilter (in my case, the second added, the one from 4). > Now messages that are decoded in step 2 end up in the output of step 4.
The problem is that you are using a CumulativeProtocolDecoder, which uses an internal buffer (the one store in the session). As soon as you have decoded a MessageA, and you call the next decoder with a byte[] extracted from MessageA, I will assume that there is no need to accumulate the bytes, so no need to use a CumulativeProtocolDecoder... If, and only if, you need to cumulate some data after having decoded more than one MessageA, then you need another implementation of the CumulativeProtocolDecoder, using its own storage for the acumulated bytes. That should do the trick. -- Regards, Cordialement, Emmanuel Lécharny www.iktek.com
