Home / Function/ reentryOnHandshakeComplete() — netty Function Reference

reentryOnHandshakeComplete() — netty Function Reference

Architecture documentation for the reentryOnHandshakeComplete() function in ParameterizedSslHandlerTest.java from the netty codebase.

Function java Buffer Allocators calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  0b352753_ce25_c72b_dce1_343fa81f2b50["reentryOnHandshakeComplete()"]
  4741a6a1_c002_17c2_c8d8_747d98eb437c["ParameterizedSslHandlerTest"]
  0b352753_ce25_c72b_dce1_343fa81f2b50 -->|defined in| 4741a6a1_c002_17c2_c8d8_747d98eb437c
  2c8f6b94_cc46_ec4d_c85d_4c14de94520f["reentryOnHandshakeCompleteNioChannel()"]
  2c8f6b94_cc46_ec4d_c85d_4c14de94520f -->|calls| 0b352753_ce25_c72b_dce1_343fa81f2b50
  a544c94d_f2e5_efaf_bba5_bf11254f4fe6["reentryOnHandshakeCompleteLocalChannel()"]
  a544c94d_f2e5_efaf_bba5_bf11254f4fe6 -->|calls| 0b352753_ce25_c72b_dce1_343fa81f2b50
  dc0bc1ef_d695_bbae_02e4_2f07fe2fb723["ReentryWriteSslHandshakeHandler()"]
  0b352753_ce25_c72b_dce1_343fa81f2b50 -->|calls| dc0bc1ef_d695_bbae_02e4_2f07fe2fb723
  style 0b352753_ce25_c72b_dce1_343fa81f2b50 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/test/java/io/netty/handler/ssl/ParameterizedSslHandlerTest.java lines 557–622

    private void reentryOnHandshakeComplete(SslProvider clientProvider, SslProvider serverProvider,
                                            EventLoopGroup group, SocketAddress bindAddress,
                                            Class<? extends ServerChannel> serverClass,
                                            Class<? extends Channel> clientClass, boolean serverAutoRead,
                                            boolean clientAutoRead) throws Exception {
        SelfSignedCertificate ssc = CachedSelfSignedCertificate.getCachedCertificate();
        final SslContext sslServerCtx = SslContextBuilder.forServer(ssc.certificate(), ssc.privateKey())
                .sslProvider(serverProvider)
                .build();

        final SslContext sslClientCtx = SslContextBuilder.forClient()
                .trustManager(InsecureTrustManagerFactory.INSTANCE)
                .sslProvider(clientProvider)
                .build();

        Channel sc = null;
        Channel cc = null;
        try {
            final String expectedContent = "HelloWorld";
            final CountDownLatch serverLatch = new CountDownLatch(1);
            final CountDownLatch clientLatch = new CountDownLatch(1);
            final StringBuilder serverQueue = new StringBuilder(expectedContent.length());
            final StringBuilder clientQueue = new StringBuilder(expectedContent.length());

            sc = new ServerBootstrap()
                    .group(group)
                    .channel(serverClass)
                    .childOption(ChannelOption.AUTO_READ, serverAutoRead)
                    .childHandler(new ChannelInitializer<Channel>() {
                        @Override
                        protected void initChannel(Channel ch) {
                            ch.pipeline().addLast(disableHandshakeTimeout(sslServerCtx.newHandler(ch.alloc())));
                            ch.pipeline().addLast(new ReentryWriteSslHandshakeHandler(expectedContent, serverQueue,
                                    serverLatch));
                        }
                    }).bind(bindAddress).syncUninterruptibly().channel();

            cc = new Bootstrap()
                    .group(group)
                    .channel(clientClass)
                    .option(ChannelOption.AUTO_READ, clientAutoRead)
                    .handler(new ChannelInitializer<Channel>() {
                        @Override
                        protected void initChannel(Channel ch) {
                            ch.pipeline().addLast(disableHandshakeTimeout(sslClientCtx.newHandler(ch.alloc())));
                            ch.pipeline().addLast(new ReentryWriteSslHandshakeHandler(expectedContent, clientQueue,
                                    clientLatch));
                        }
                    }).connect(sc.localAddress()).syncUninterruptibly().channel();

            serverLatch.await();
            assertEquals(expectedContent, serverQueue.toString());
            clientLatch.await();
            assertEquals(expectedContent, clientQueue.toString());
        } finally {
            if (cc != null) {
                cc.close().syncUninterruptibly();
            }
            if (sc != null) {
                sc.close().syncUninterruptibly();
            }

            ReferenceCountUtil.release(sslServerCtx);
            ReferenceCountUtil.release(sslClientCtx);
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does reentryOnHandshakeComplete() do?
reentryOnHandshakeComplete() is a function in the netty codebase, defined in handler/src/test/java/io/netty/handler/ssl/ParameterizedSslHandlerTest.java.
Where is reentryOnHandshakeComplete() defined?
reentryOnHandshakeComplete() is defined in handler/src/test/java/io/netty/handler/ssl/ParameterizedSslHandlerTest.java at line 557.
What does reentryOnHandshakeComplete() call?
reentryOnHandshakeComplete() calls 1 function(s): ReentryWriteSslHandshakeHandler.
What calls reentryOnHandshakeComplete()?
reentryOnHandshakeComplete() is called by 2 function(s): reentryOnHandshakeCompleteLocalChannel, reentryOnHandshakeCompleteNioChannel.

Analyze Your Own Codebase

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

Try Supermodel Free