mina-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Apfel" <james.ap...@gmail.com>
Subject ProtocolEncoderOutput and many ByteBuffer(s)
Date Mon, 01 Oct 2007 13:29:48 GMT
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);
}

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