diff --git a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java index 4048993df9..f0c70a3b4e 100644 --- a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java +++ b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java @@ -314,13 +314,6 @@ public abstract class AbstractTrafficShapingHandler extends ChannelDuplexHandler return trafficCounter; } - @Override - public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { - if (trafficCounter != null) { - trafficCounter.stop(); - } - } - @Override public String toString() { return "TrafficShaping with Write Limit: " + writeLimit + diff --git a/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java b/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java index bebd7453d6..f296f6f691 100644 --- a/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java +++ b/handler/src/main/java/io/netty/handler/traffic/ChannelTrafficShapingHandler.java @@ -91,4 +91,11 @@ public class ChannelTrafficShapingHandler extends AbstractTrafficShapingHandler setTrafficCounter(trafficCounter); trafficCounter.start(); } + + @Override + public void handlerRemoved(ChannelHandlerContext ctx) throws Exception { + if (trafficCounter != null) { + trafficCounter.stop(); + } + } }