Search in sources :

Example 96 with HttpObjectAggregator

use of org.apache.flink.shaded.netty4.io.netty.handler.codec.http.HttpObjectAggregator in project apollo by apollo-rsps.

the class HttpChannelInitializer method initChannel.

@Override
protected void initChannel(SocketChannel ch) throws Exception {
    ChannelPipeline pipeline = ch.pipeline();
    pipeline.addLast("decoder", new HttpRequestDecoder());
    pipeline.addLast("chunker", new HttpObjectAggregator(MAX_REQUEST_LENGTH));
    pipeline.addLast("encoder", new HttpResponseEncoder());
    pipeline.addLast("timeout", new IdleStateHandler(NetworkConstants.IDLE_TIME, 0, 0));
    pipeline.addLast("handler", handler);
}
Also used : HttpResponseEncoder(io.netty.handler.codec.http.HttpResponseEncoder) HttpObjectAggregator(io.netty.handler.codec.http.HttpObjectAggregator) HttpRequestDecoder(io.netty.handler.codec.http.HttpRequestDecoder) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) ChannelPipeline(io.netty.channel.ChannelPipeline)

Aggregations

HttpObjectAggregator (io.netty.handler.codec.http.HttpObjectAggregator)95 ChannelPipeline (io.netty.channel.ChannelPipeline)60 HttpServerCodec (io.netty.handler.codec.http.HttpServerCodec)34 HttpRequestDecoder (io.netty.handler.codec.http.HttpRequestDecoder)29 HttpResponseEncoder (io.netty.handler.codec.http.HttpResponseEncoder)28 HttpClientCodec (io.netty.handler.codec.http.HttpClientCodec)25 SocketChannel (io.netty.channel.socket.SocketChannel)20 ChunkedWriteHandler (io.netty.handler.stream.ChunkedWriteHandler)18 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)17 NioSocketChannel (io.netty.channel.socket.nio.NioSocketChannel)17 NioEventLoopGroup (io.netty.channel.nio.NioEventLoopGroup)16 Bootstrap (io.netty.bootstrap.Bootstrap)13 Channel (io.netty.channel.Channel)12 EventLoopGroup (io.netty.channel.EventLoopGroup)11 EmbeddedChannel (io.netty.channel.embedded.EmbeddedChannel)11 SslHandler (io.netty.handler.ssl.SslHandler)11 HttpContentCompressor (io.netty.handler.codec.http.HttpContentCompressor)10 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)9 ServerBootstrap (io.netty.bootstrap.ServerBootstrap)8 NioServerSocketChannel (io.netty.channel.socket.nio.NioServerSocketChannel)8