Home / Function/ close() — netty Function Reference

close() — netty Function Reference

Architecture documentation for the close() function in WebSocketProtocolHandler.java from the netty codebase.

Function java ProtocolCodecs HTTP calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  791f6a38_ba17_97d5_517e_667c306cfa1d["close()"]
  d25f6f34_2ca3_7948_600a_8eae12cd9427["WebSocketProtocolHandler"]
  791f6a38_ba17_97d5_517e_667c306cfa1d -->|defined in| d25f6f34_2ca3_7948_600a_8eae12cd9427
  bf36d495_1b20_f493_de4f_707f441d2dfc["exceptionCaught()"]
  bf36d495_1b20_f493_de4f_707f441d2dfc -->|calls| 791f6a38_ba17_97d5_517e_667c306cfa1d
  93dcb75c_433c_bb38_9442_952cb62c0d43["write()"]
  791f6a38_ba17_97d5_517e_667c306cfa1d -->|calls| 93dcb75c_433c_bb38_9442_952cb62c0d43
  3883fff1_b23b_cdc7_84d9_b92eac4a9da3["flush()"]
  791f6a38_ba17_97d5_517e_667c306cfa1d -->|calls| 3883fff1_b23b_cdc7_84d9_b92eac4a9da3
  bab512bf_e3c9_2d9c_23a0_307fbdc7e956["applyCloseSentTimeout()"]
  791f6a38_ba17_97d5_517e_667c306cfa1d -->|calls| bab512bf_e3c9_2d9c_23a0_307fbdc7e956
  style 791f6a38_ba17_97d5_517e_667c306cfa1d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketProtocolHandler.java lines 91–103

    @Override
    public void close(final ChannelHandlerContext ctx, final ChannelPromise promise) throws Exception {
        if (closeStatus == null || !ctx.channel().isActive()) {
            ctx.close(promise);
        } else {
            if (closeSent == null) {
                write(ctx, new CloseWebSocketFrame(closeStatus), ctx.newPromise());
            }
            flush(ctx);
            applyCloseSentTimeout(ctx);
            closeSent.addListener(future -> ctx.close(promise));
        }
    }

Subdomains

Called By

Frequently Asked Questions

What does close() do?
close() is a function in the netty codebase, defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketProtocolHandler.java.
Where is close() defined?
close() is defined in codec-http/src/main/java/io/netty/handler/codec/http/websocketx/WebSocketProtocolHandler.java at line 91.
What does close() call?
close() calls 3 function(s): applyCloseSentTimeout, flush, write.
What calls close()?
close() is called by 1 function(s): exceptionCaught.

Analyze Your Own Codebase

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

Try Supermodel Free