public class ChannelTrafficShapingHandler extends AbstractTrafficShapingHandler
AbstractTrafficShapingHandler is for channel
traffic shaping, that is to say a per channel limitation of the bandwidth.checkInterval, DEFAULT_CHECK_INTERVAL, DEFAULT_MAX_TIME, maxTime, trafficCounter| Constructor and Description |
|---|
ChannelTrafficShapingHandler(long checkInterval)
Create a new instance
|
ChannelTrafficShapingHandler(long writeLimit,
long readLimit)
Create a new instance
|
ChannelTrafficShapingHandler(long writeLimit,
long readLimit,
long checkInterval)
Create a new instance
|
ChannelTrafficShapingHandler(long writeLimit,
long readLimit,
long checkInterval,
long maxTime)
Create a new instance
|
| Modifier and Type | Method and Description |
|---|---|
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
submitWrite(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
long delay,
io.netty.channel.ChannelPromise promise) |
calculateSize, channelRead, configure, configure, configure, doAccounting, getCheckInterval, getMaxTimeWait, getReadLimit, getWriteLimit, isHandlerActive, read, setCheckInterval, setMaxTimeWait, setReadLimit, setWriteLimit, toString, trafficCounter, writebind, close, connect, deregister, disconnect, flushchannelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggeredpublic ChannelTrafficShapingHandler(long writeLimit,
long readLimit,
long checkInterval,
long maxTime)
writeLimit - 0 or a limit in bytes/sreadLimit - 0 or a limit in bytes/scheckInterval - The delay between two computations of performances for
channels or 0 if no stats are to be computedmaxTime - The maximum delay to wait in case of traffic excesspublic ChannelTrafficShapingHandler(long writeLimit,
long readLimit,
long checkInterval)
writeLimit - 0 or a limit in bytes/sreadLimit - 0 or a limit in bytes/scheckInterval - The delay between two computations of performances for
channels or 0 if no stats are to be computedpublic ChannelTrafficShapingHandler(long writeLimit,
long readLimit)
writeLimit - 0 or a limit in bytes/sreadLimit - 0 or a limit in bytes/spublic ChannelTrafficShapingHandler(long checkInterval)
checkInterval - The delay between two computations of performances for
channels or 0 if no stats are to be computedpublic void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterExceptionpublic void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerRemoved in interface io.netty.channel.ChannelHandlerhandlerRemoved in class io.netty.channel.ChannelHandlerAdapterExceptionprotected void submitWrite(io.netty.channel.ChannelHandlerContext ctx,
Object msg,
long delay,
io.netty.channel.ChannelPromise promise)
submitWrite in class AbstractTrafficShapingHandlerCopyright © 2008–2014 The Netty Project. All rights reserved.