[#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 @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 { throws Exception {
long curtime = System.currentTimeMillis(); long curtime = System.currentTimeMillis();
long size = calculateSize(msg); long size = calculateSize(msg);
@ -297,7 +297,7 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler
ctx.executor().schedule(new Runnable() { ctx.executor().schedule(new Runnable() {
@Override @Override
public void run() { public void run() {
ctx.write(msg); ctx.write(msg, promise);
} }
}, wait, TimeUnit.MILLISECONDS); }, wait, TimeUnit.MILLISECONDS);
return; return;