From 54c97d07202d98eac734beacf885579973b515b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Br=C3=A9gier?= Date: Sun, 20 May 2012 16:36:45 +0300 Subject: [PATCH 1/8] Same fix than in version 3.5 for Master branch (refer to issue #345) Will be proposed once the one in 3.5 will be validated --- .../AbstractTrafficShapingHandler.java | 209 +++++++++--------- 1 file changed, 104 insertions(+), 105 deletions(-) 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 d97fb5a9a1..bc7b9d406a 100644 --- a/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java +++ b/handler/src/main/java/io/netty/handler/traffic/AbstractTrafficShapingHandler.java @@ -15,7 +15,7 @@ */ package io.netty.handler.traffic; -import java.util.concurrent.Executor; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicBoolean; import io.netty.channel.Channel; @@ -30,7 +30,9 @@ import io.netty.handler.execution.DefaultObjectSizeEstimator; import io.netty.logging.InternalLogger; import io.netty.logging.InternalLoggerFactory; import io.netty.util.ExternalResourceReleasable; -import io.netty.util.internal.ExecutorUtil; +import io.netty.util.Timeout; +import io.netty.util.Timer; +import io.netty.util.TimerTask; /** * AbstractTrafficShapingHandler allows to limit the global bandwidth @@ -41,6 +43,10 @@ import io.netty.util.internal.ExecutorUtil; * the method doAccounting of this handler.
*
* + * An {@link ObjectSizeEstimator} can be passed at construction to specify what + * is the size of the object to be read or write accordingly to the type of + * object. If not specified, it will used the {@link DefaultObjectSizeEstimator} implementation.

+ * * If you want for any particular reasons to stop the monitoring (accounting) or to change * the read/write limit or the check interval, several methods allow that for you:
*