0

ChannelProgressiveFutureListener iterface の operationProgressed メソッドで進行状況と合計変数が何を表しているのか、いずれかを説明してください。

 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
4

1 に答える 1

0

progressパーセント単位の進行状況であり、total「進行状況が到達したときに操作の終了を示す数値。操作の終了が不明な場合は -1」です。

Netty API ドキュメントをご覧ください。

于 2013-07-31T14:57:49.620 に答える