List of usage examples for io.netty.handler.flush FlushConsolidationHandler FlushConsolidationHandler
public FlushConsolidationHandler()
From source file:com.linecorp.armeria.client.HttpClientPipelineConfigurator.java
License:Apache License
@Override public void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress, SocketAddress localAddress, ChannelPromise promise) throws Exception { // Remember the requested remote address for later use. final InetSocketAddress inetRemoteAddr = (InetSocketAddress) remoteAddress; this.remoteAddress = inetRemoteAddr; // Configure the pipeline. final Channel ch = ctx.channel(); final ChannelPipeline p = ch.pipeline(); p.addLast(new FlushConsolidationHandler()); p.addLast(ReadSuppressingHandler.INSTANCE); try {/* w w w.jav a2 s . c o m*/ if (sslCtx != null) { configureAsHttps(ch, inetRemoteAddr); } else { configureAsHttp(ch); } } catch (Throwable t) { promise.tryFailure(t); ctx.close(); } finally { if (p.context(this) != null) { p.remove(this); } } ctx.connect(remoteAddress, localAddress, promise); }
From source file:com.linecorp.armeria.server.HttpServerPipelineConfigurator.java
License:Apache License
@Override protected void initChannel(Channel ch) throws Exception { final ChannelPipeline p = ch.pipeline(); p.addLast(new FlushConsolidationHandler()); p.addLast(ReadSuppressingHandler.INSTANCE); configurePipeline(p, port.protocols(), null); }