Home / Function/ closeOutboundAndInbound() — netty Function Reference

closeOutboundAndInbound() — netty Function Reference

Architecture documentation for the closeOutboundAndInbound() function in SSLEngineTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f25b1f05_b981_6c36_3ee6_e0ab50a29057["closeOutboundAndInbound()"]
  9150c92a_2afc_b83a_c3bf_86dfac6e9d9b["SSLEngineTest"]
  f25b1f05_b981_6c36_3ee6_e0ab50a29057 -->|defined in| 9150c92a_2afc_b83a_c3bf_86dfac6e9d9b
  5b1aff79_52fd_e366_c29d_676e7d63d1e6["doHandshakeVerifyReusedAndClose()"]
  5b1aff79_52fd_e366_c29d_676e7d63d1e6 -->|calls| f25b1f05_b981_6c36_3ee6_e0ab50a29057
  style f25b1f05_b981_6c36_3ee6_e0ab50a29057 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java lines 3411–3470

    private void closeOutboundAndInbound(
            BufferType type, SSLEngine clientEngine, SSLEngine serverEngine) throws SSLException {
        assertFalse(clientEngine.isInboundDone());
        assertFalse(clientEngine.isOutboundDone());
        assertFalse(serverEngine.isInboundDone());
        assertFalse(serverEngine.isOutboundDone());

        ByteBuffer empty = allocateBuffer(type, 0);

        // Ensure we allocate a bit more so we can fit in multiple packets. This is needed as we may call multiple
        // time wrap / unwrap in a for loop before we drain the buffer we are writing in.
        ByteBuffer cTOs = allocateBuffer(type, clientEngine.getSession().getPacketBufferSize() * 4);
        ByteBuffer sTOs = allocateBuffer(type, serverEngine.getSession().getPacketBufferSize() * 4);
        ByteBuffer cApps = allocateBuffer(type, clientEngine.getSession().getApplicationBufferSize() * 4);
        ByteBuffer sApps = allocateBuffer(type, serverEngine.getSession().getApplicationBufferSize() * 4);

        clientEngine.closeOutbound();
        for (;;) {
            // call wrap till we produced all data
            SSLEngineResult result = clientEngine.wrap(empty, cTOs);
            if (result.getStatus() == Status.CLOSED && result.bytesProduced() == 0) {
                break;
            }
            assertTrue(cTOs.hasRemaining());
        }
        cTOs.flip();

        for (;;) {
            // call unwrap till we consumed all data
            SSLEngineResult result = serverEngine.unwrap(cTOs, sApps);
            if (result.getStatus() == Status.CLOSED && result.bytesProduced() == 0) {
                break;
            }
            assertTrue(sApps.hasRemaining());
        }

        serverEngine.closeOutbound();
        for (;;) {
            // call wrap till we produced all data
            SSLEngineResult result = serverEngine.wrap(empty, sTOs);
            if (result.getStatus() == Status.CLOSED && result.bytesProduced() == 0) {
                break;
            }
            assertTrue(sTOs.hasRemaining());
        }
        sTOs.flip();

        for (;;) {
            // call unwrap till we consumed all data
            SSLEngineResult result = clientEngine.unwrap(sTOs, cApps);
            if (result.getStatus() == Status.CLOSED && result.bytesProduced() == 0) {
                break;
            }
            assertTrue(cApps.hasRemaining());
        }

        // Now close the inbound as well
        clientEngine.closeInbound();
        serverEngine.closeInbound();
    }

Domain

Subdomains

Frequently Asked Questions

What does closeOutboundAndInbound() do?
closeOutboundAndInbound() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java.
Where is closeOutboundAndInbound() defined?
closeOutboundAndInbound() is defined in handler/src/test/java/io/netty/handler/ssl/SSLEngineTest.java at line 3411.
What calls closeOutboundAndInbound()?
closeOutboundAndInbound() is called by 1 function(s): doHandshakeVerifyReusedAndClose.

Analyze Your Own Codebase

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

Try Supermodel Free