Home / Function/ wrapAndFlush() — netty Function Reference

wrapAndFlush() — netty Function Reference

Architecture documentation for the wrapAndFlush() function in SslHandler.java from the netty codebase.

Function java Buffer Allocators calls 3 called by 2

Entity Profile

Dependency Diagram

graph TD
  1b465b2e_ec05_393c_4b3a_f882c72d8cc3["wrapAndFlush()"]
  d8b07a7c_44f8_c4e9_efe8_49bfae7d4af1["SslHandler"]
  1b465b2e_ec05_393c_4b3a_f882c72d8cc3 -->|defined in| d8b07a7c_44f8_c4e9_efe8_49bfae7d4af1
  c5a95111_bf75_eef9_82e9_d3b52fb23759["flush()"]
  c5a95111_bf75_eef9_82e9_d3b52fb23759 -->|calls| 1b465b2e_ec05_393c_4b3a_f882c72d8cc3
  1807eec1_6f0b_edf4_8d02_a6d15d3c18c1["handleUnwrapThrowable()"]
  1807eec1_6f0b_edf4_8d02_a6d15d3c18c1 -->|calls| 1b465b2e_ec05_393c_4b3a_f882c72d8cc3
  586d9480_c5dd_d8c2_fcc9_bd16fdeca640["setState()"]
  1b465b2e_ec05_393c_4b3a_f882c72d8cc3 -->|calls| 586d9480_c5dd_d8c2_fcc9_bd16fdeca640
  ca3c58ac_45a7_24e9_d74b_140cea69627e["wrap()"]
  1b465b2e_ec05_393c_4b3a_f882c72d8cc3 -->|calls| ca3c58ac_45a7_24e9_d74b_140cea69627e
  97e069a2_d061_156b_5f87_33bbcfd62f59["forceFlush()"]
  1b465b2e_ec05_393c_4b3a_f882c72d8cc3 -->|calls| 97e069a2_d061_156b_5f87_33bbcfd62f59
  style 1b465b2e_ec05_393c_4b3a_f882c72d8cc3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/ssl/SslHandler.java lines 830–848

    private void wrapAndFlush(ChannelHandlerContext ctx) throws SSLException {
        if (pendingUnencryptedWrites.isEmpty()) {
            // It's important to NOT use a voidPromise here as the user
            // may want to add a ChannelFutureListener to the ChannelPromise later.
            //
            // See https://github.com/netty/netty/issues/3364
            pendingUnencryptedWrites.add(Unpooled.EMPTY_BUFFER, ctx.newPromise());
        }
        if (!handshakePromise.isDone()) {
            setState(STATE_FLUSHED_BEFORE_HANDSHAKE);
        }
        try {
            wrap(ctx, false);
        } finally {
            // We may have written some parts of data before an exception was thrown so ensure we always flush.
            // See https://github.com/netty/netty/issues/3900#issuecomment-172481830
            forceFlush(ctx);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does wrapAndFlush() do?
wrapAndFlush() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/ssl/SslHandler.java.
Where is wrapAndFlush() defined?
wrapAndFlush() is defined in handler/src/main/java/io/netty/handler/ssl/SslHandler.java at line 830.
What does wrapAndFlush() call?
wrapAndFlush() calls 3 function(s): forceFlush, setState, wrap.
What calls wrapAndFlush()?
wrapAndFlush() is called by 2 function(s): flush, handleUnwrapThrowable.

Analyze Your Own Codebase

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

Try Supermodel Free