How do you process more than one message in the same call ?
JYL
Le 7 févr. 2012 01:09, "Robert Tomczyk" <[email protected]> a écrit :
> Hi. Im using MINA 2.0.4 on windows 7 32-bit. As a decoder im using CPD,
> running locally.
> On client side decoder works without issues, it takes care of incomplete
> message and more than one message in buffer as well. Nothing is blocking.
> On server side im using same algorithm.
>
> if(in.prefixedDataAvaliable(4)) // read message type
> {
> if(in.prefixedDataAvaliable(4)) // read message length
> {
> if(in.remaining() >= messageLength)
> {
> // decode
> }
> else
> {
> return false;
> }
> }
> else
> {
> return false;
> }
> }
> else
> {
> return false;
> }
>
> Problem is that some of the messages cant pass first step, it doesnt matter
> if they are incomplet or overcomplet. They return false. But when i
> manually trying to get int, value which should be read is correct. Why is
> that happens ? Why it happens only for coupe of messages ?
> Encoder sends bytes properly.
>