Hi, I think i found where the problem is. So first of all, my decoder works fine in case when only one message (fully complete, not less,not more) is in buffer (incoming 111, remaining 111, when expecting 111) and then second one sended after first (incoming 24, remaining 24, when expecting 24).
But when for example incoming bytes contain more than one message (135 instead of 111) i mean that after decoding first 111 bytes (which containts 1 byte enum,4 byte msg length,106 message, and it is decoded fine) i have to do something with rest of bytes. Now, logically I should take care of the rest of 24 bytes, and i mean by that put the whole decoder in a loop: while(in.hasRemaining()) { // decode } return true; But, im getting 22 bytes instead of 24. But its not a problem,because when its not enough data i just return false. But when im trying to take over a first IF of "decoder algorithm" (if.prefixedDataAvaliable(1) which i read enum) im getting message type that i didnt even send (i believe MINA reads one byte and convert it to enum, but since this isnt an enum i expected, im getting something that JVM have translated from this byte). Isn`t it a problem with trying to read enum TWO TIMES in one buffer? Its something similiar to putting two or more strings and then getting all of them in one getString(...) ? 2012/1/25 Emmanuel Lécharny <elecha...@apache.org> > On 1/25/12 1:11 AM, Robert Tomczyk wrote: > >> So considering your answer it seems that all is fine, but it isnt. So can >> you show me example how will you do it(local on windows). I mean >> decoding,encoding,charset type for two messages 1st String + two ints , >> 2nd >> String + long. And you will be sure that it working 100%. Im running out >> of >> ideas... >> > Sorry, your bug, your pain. I have already spent too much of my time to > try to explain you how MINA was working, I'm not going to code your > application. > > > > > -- > Regards, > Cordialement, > Emmanuel Lécharny > www.iktek.com > >