You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by da...@daune-consult.com on 2006/03/23 08:13:57 UTC

New ByteBuffer feature

Hi,

I noticed that DIRMINA-165 is now fixed.

I have taken a look at this as I need to send same messages to different
parties, and this patch is likely to increase performances.

Unfortunately, I have not really understood what I am supposed to do to take
benefit of this new feature.

Could someone explain how to create 'reference' messages and send them?

Thanks & Regards,

J-F


Re: New ByteBuffer feature

Posted by Trustin Lee <tr...@gmail.com>.
Hi J-F,

On 3/23/06, daune.jf@daune-consult.com <da...@daune-consult.com> wrote:
>
> I noticed that DIRMINA-165 is now fixed.


Yep, finally.

I have taken a look at this as I need to send same messages to different
> parties, and this patch is likely to increase performances.
>
> Unfortunately, I have not really understood what I am supposed to do to
> take
> benefit of this new feature.


For example, in case you send multiple identical messages to multiple
sessions:

List<IoSession> sessions = ...;

ByteBuffer message = ...;

for (IoSession s : sessions) {
    s.write( message.duplicate() );  // works in the same way with nio
buffers
}

HTH,
Trustin
--
what we call human nature is actually human habit
--
http://gleamynode.net/
--
PGP key fingerprints:
* E167 E6AF E73A CBCE EE41  4A29 544D DE48 FE95 4E7E
* B693 628E 6047 4F8F CFA4  455E 1C62 A7DC 0255 ECA6