>> >> Suppose session is the reference to the same session throughout >> >> 1) when a message is not yet transferred since last session.write >> call, if a thread calls session.write does the message goes to queue >> and no part of it is transferred until the previous message is done? > > Depends. If you have added an unordered ExecutorFilter into your chain, then > it can happens. The default behavior is that once each session is attached > to one single IoProcessor, it will be fully enqueued before another write > for this very session can be enqueued.
So, when an unordered ExecutorFilter is in action, it can reassign a session to a different IoProcessor? >> 2) if two distinct threads call the session.write (on the same session >> reference), with different messages they will appear in the same >> message queue, but due to queue locking only one of them will start >> being transferred via network? > > There is one queue per session, so they will push the messages into one > single queue. As the enqueued messages are transfered to the Channel one by > one, until the current message has been completely written, you can't send a > part of a message, then a part of another, then another part of the first > message...