mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hanson Char" <hanson.c...@gmail.com>
Subject Re: Question from developers
Date Fri, 15 Sep 2006 14:37:57 GMT
>
> It is because the I/O thread will move the position when it writes the
> buffer you specified.  So you have to duplicate the buffer:
>
> buf.flip();
> for each session {
>     session.write(buf.duplicate());
> }
>


Of course (in hindsight), for the session.write() is asyn!  A trivial
thought: if the method "write" is named "asynWrite", it would have explained
itself in the first place.

Hanson

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message