Home / Function/ sendHttpResponse() — netty Function Reference

sendHttpResponse() — netty Function Reference

Architecture documentation for the sendHttpResponse() function in AutobahnServerHandler.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  ae872491_ad06_d7be_5add_fde8a3b97c5f["sendHttpResponse()"]
  ae745e27_4df1_b3ea_fa42_b6885b919f66["AutobahnServerHandler"]
  ae872491_ad06_d7be_5add_fde8a3b97c5f -->|defined in| ae745e27_4df1_b3ea_fa42_b6885b919f66
  9582854a_5889_5658_7efd_36d66fcb998f["handleHttpRequest()"]
  9582854a_5889_5658_7efd_36d66fcb998f -->|calls| ae872491_ad06_d7be_5add_fde8a3b97c5f
  style ae872491_ad06_d7be_5add_fde8a3b97c5f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java lines 120–135

    private static void sendHttpResponse(
            ChannelHandlerContext ctx, HttpRequest req, FullHttpResponse res) {
        // Generate an error page if response status code is not OK (200).
        if (res.status().code() != 200) {
            ByteBuf buf = Unpooled.copiedBuffer(res.status().toString(), CharsetUtil.UTF_8);
            res.content().writeBytes(buf);
            buf.release();
            setContentLength(res, res.content().readableBytes());
        }

        // Send the response and close the connection if necessary.
        ChannelFuture f = ctx.channel().writeAndFlush(res);
        if (!isKeepAlive(req) || res.status().code() != 200) {
            f.addListener(ChannelFutureListener.CLOSE);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does sendHttpResponse() do?
sendHttpResponse() is a function in the netty codebase, defined in testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java.
Where is sendHttpResponse() defined?
sendHttpResponse() is defined in testsuite-autobahn/src/main/java/io/netty/testsuite/autobahn/AutobahnServerHandler.java at line 120.
What calls sendHttpResponse()?
sendHttpResponse() is called by 1 function(s): handleHttpRequest.

Analyze Your Own Codebase

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

Try Supermodel Free