Home / Function/ channelRead0() — netty Function Reference

channelRead0() — netty Function Reference

Architecture documentation for the channelRead0() function in HttpNativeServerHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  975b8e0d_534b_6923_462b_cc8bdd754e3c["channelRead0()"]
  f68147b4_a73a_8a4e_31d5_88c68b7d895e["HttpNativeServerHandler"]
  975b8e0d_534b_6923_462b_cc8bdd754e3c -->|defined in| f68147b4_a73a_8a4e_31d5_88c68b7d895e
  style 975b8e0d_534b_6923_462b_cc8bdd754e3c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite-native-image/src/main/java/io/netty/testsuite/svm/HttpNativeServerHandler.java lines 51–68

    @Override
    public void channelRead0(ChannelHandlerContext ctx, HttpObject msg) {
        if (msg instanceof HttpRequest) {
            HttpRequest req = (HttpRequest) msg;

            boolean keepAlive = HttpUtil.isKeepAlive(req);
            FullHttpResponse response = new DefaultFullHttpResponse(HTTP_1_1, OK, Unpooled.wrappedBuffer(CONTENT));
            response.headers().set(CONTENT_TYPE, "text/plain");
            response.headers().setInt(CONTENT_LENGTH, response.content().readableBytes());
            httpRequestFuture.complete(null);
            if (!keepAlive) {
                ctx.write(response).addListener(ChannelFutureListener.CLOSE);
            } else {
                response.headers().set(CONNECTION, KEEP_ALIVE);
                ctx.write(response);
            }
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does channelRead0() do?
channelRead0() is a function in the netty codebase, defined in testsuite-native-image/src/main/java/io/netty/testsuite/svm/HttpNativeServerHandler.java.
Where is channelRead0() defined?
channelRead0() is defined in testsuite-native-image/src/main/java/io/netty/testsuite/svm/HttpNativeServerHandler.java at line 51.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free