Are multiple socketChannel.write() messages applied in order?
Server Dude
vishy_kasar at yahoo.com
Thu Jul 1 18:04:08 EDT 2010
I have to write multiple buffers to a socket channel in order. i.e. The
buffer written first should be applied first.
Can I just write code like:
option #1
----------
channel.write(buffer1);
channel.write(buffer2);
or do I have to write some thing like:
option #2
----------
ChannelFuture future = channel.write(buffer1);
future.addListener(new ChannelFutureListener() {
public void operationComplete(ChannelFuture future) throws Exception {
if (future.isSuccess()) {
future.getChannel().write(buffer2);
}
}
});
The option #1 seem to work for me. Wanted to know if I can rely on that. The
Socket Channel write javadoc does not tell any thing about the order of
message application.
The above code is simplified. In real life, these buffers are not available
together but arrive over network. So my logic for write will reside in a
messageReceived() method.
--
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Are-multiple-socketChannel-write-messages-applied-in-order-tp5245525p5245525.html
Sent from the Netty User Group mailing list archive at Nabble.com.
More information about the netty-users
mailing list