请解释一下,ChannelProgressiveFutureListener iterface的operationProgressed方法中的progress和total变量代表什么,是不是代表total no bytes transfer,下面是代码及其输出结果:
ChannelFuture future = channel.writeAndFlush(bodyRequestEncoder, channel.newProgressivePromise());
future.addListener(new ChannelProgressiveFutureListener() {
@Override
public void operationComplete(ChannelProgressiveFuture future) throws Exception {
// TODO Auto-generated method stub
}
@Override
public void operationProgressed(ChannelProgressiveFuture future, long progress, long total) throws Exception {
System.out.println("progress : " + progress + " of total: " + total);
}
});
和控制台输出:
progress : 1 of total: -1
progress : 2 of total: -1
progress : 3 of total: -1
progress : 4 of total: -1
progress : 5 of total: -1
progress : 6 of total: -1
progress : 7 of total: -1