List of usage examples for io.netty.handler.traffic GlobalTrafficShapingHandler GlobalTrafficShapingHandler
public GlobalTrafficShapingHandler(EventExecutor executor)
From source file:com.mycompany.nettyweb.HttpServerInitializer.java
@Override public void initChannel(SocketChannel ch) throws Exception { ChannelPipeline p = ch.pipeline();//from w ww. j a v a 2s. c o m GlobalTrafficShapingHandler globalTrafficShapingHandler = new GlobalTrafficShapingHandler(ch.eventLoop()); trafficCounter = globalTrafficShapingHandler.trafficCounter(); trafficCounter.start(); p.addLast(globalTrafficShapingHandler); p.addLast("codec", new HttpServerCodec()); p.addLast("handler", new HttpServerHandler(trafficCounter, statistics)); }