HttpServerInitializer.java 文件源码

java
阅读 29 收藏 0 点赞 0 评论 0

项目:SI 作者:
@Override
public void initChannel(SocketChannel ch) {
    ChannelPipeline pipeline = ch.pipeline();
    if (sslCtx != null) {
        pipeline.addLast(sslCtx.newHandler(ch.alloc()));
    }
    pipeline.addLast(new HttpResponseEncoder());
    pipeline.addLast(new HttpRequestDecoder());
    // Uncomment the following line if you don't want to handle HttpChunks.
    //pipeline.addLast("chunkedWriter", new ChunkedWriteHandler());
    //p.addLast(new HttpObjectAggregator(1048576));
    // Remove the following line if you don't want automatic content compression.
    //pipeline.addLast(new HttpContentCompressor());

    // Uncomment the following line if you don't want to handle HttpContents.
    pipeline.addLast(new HttpObjectAggregator(65536));
    pipeline.addLast("readTimeoutHandler", new ReadTimeoutHandler(READ_TIMEOUT));
    pipeline.addLast("myHandler", new MyHandler());

    pipeline.addLast("handler", new HttpServerHandler(listener));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号