[#1732] Fix bug which lead ChannelTrafficShapingHandler stop to work after first Channel was disconnected

This commit is contained in:
Norman Maurer 2013-08-13 08:09:59 +02:00
parent cc12e40065
commit f8f19d1539
2 changed files with 7 additions and 7 deletions

View File

@ -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 +

View File

@ -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();
}
}
}