Hi Trustin, the bug was on my side. I was accidently reading too many bytes from the ByteBuffer (the message and parts of the next message). Remember: always slice and set the limit!
James On 6/19/07, Trustin Lee <[EMAIL PROTECTED]> wrote:
Hi James, On 6/18/07, James Apfel <[EMAIL PROTECTED]> wrote: > I have a protocol with multiple MessageDecoders and the decoders have > no state. The decodable method is purely used to figure out if the > message is decodable and the actual work is done in decode. The > documentation does not mention if I have to reset the ByteBuffer in > the decodable method after I'm done with it. MINA should reset the position for you. If it doesn't, it's a bug and please let us know with an reproduceable example. > I believe I have to as I'm seeing some very weird behavior if I don't. > An another question that comes up is if the decoders share the same > ByteBuffer instance or rather if MINA takes care of resetting the > ByteBuffer positions before passing it to the next MessageDecoder? The decoders share the ByteBuffer instance, but the position is always readjusted to make sure the side effect (i.e. unexpected behavior) of a certain message decoder. HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP Key ID: 0x0255ECA6
