[#1669] Correctly notify the ChannelPromise of delayed writes

This commit is contained in:
Norman Maurer 2013-07-29 08:09:52 +02:00
parent 5e703e7419
commit 0cb3541b53

View File

@ -277,7 +277,7 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
}
@Override
public void write(final ChannelHandlerContext ctx, final Object msg, ChannelPromise promise)
public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise promise)
throws Exception {
long curtime = System.currentTimeMillis();
long size = calculateSize(msg);
@ -297,7 +297,7 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
ctx.executor().schedule(new Runnable() {
@Override
public void run() {
ctx.write(msg);
ctx.write(msg, promise);
}
}, wait, TimeUnit.MILLISECONDS);
return;