Hi,

my ProtocolEncoder encodes a Message into many ByteBuffer(s) and I wrap them
currently into a single ByteBuffer which I'm writing to
ProtocolEncoderOutput. I'm however wondering if it's OK to write the
ByteBuffer(s) straight to ProtocolEncoderOutput? I'm concerned about
Threading issues (i.e. does MINA preserve the writing order of the
ByteBuffers if I call IoSession.write(Message) from different Threads)!?

That's what I'm currently doing...

encode(ProtocolEncoderOutput out) {
    ByteBuffer first, second, third;
    ByteBuffer data = MultiByteBuffer.wrap(first, second, third);
    out.write(data);
}

... and I'm wondering if this is OK

encode(ProtocolEncoderOutput out) {
    ByteBuffer first, second, third;
    out.write(first);
    out.write(second);
    out.write(third);
}

Reply via email to