You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by Hardik Kubavat <ha...@primavera-software.com> on 2013/12/26 04:45:37 UTC

Example : Data larger than buffer size

Hii Emmanuel

1) Can you give me the example of how to manage data larger than buffer 
size?

Re: Example : Data larger than buffer size

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 12/26/13 4:45 AM, Hardik Kubavat a écrit :
> Hii Emmanuel
>
> 1) Can you give me the example of how to manage data larger than
> buffer size?

One thing : the fact that the data are bigger to the buffer size should
be irrelevant. Your application should still deal with data
fragmentation. It's perfectly pluasible that your applicatin receiveyour
data one byte at a time. Thsi is the key when dealing with TCP. For UDP,
this is different : either you receive the full packet, or the packet is
lost (but you can't tell because nothing will inform you that the packet
has been lost).

Regardless, you can use the CumulativeProtocolDecoder to cover this case
: it will gather the incoming data until you can decode a message from it.

Check ths sample :
http://mina.apache.org/mina-project/userguide/ch9-codec-filter/ch9-codec-filter.html


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com