What is the difference between Channel # write (msg) and Channel # write (msg, prom)?

I am reading the Netty Channel Javadoc: http://netty.io/4.0/api/io/netty/channel/Channel.html

But this does not say anything about the difference between Channel#write(msg)and Channel#write(msg, promise). What is the purpose of promisethe second method?

+3
source share
2 answers

ChannelPromise is a special ChannelFuture recordable channel that receives notification after an I / O operation is completed.

the method Channel#write(msg)will be delegated Channel#write(msg, promise)using DefaultChannelPromisenetty as the second parameter

+3
source

All Articles