Home / Function/ doConnect() — netty Function Reference

doConnect() — netty Function Reference

Architecture documentation for the doConnect() function in Bootstrap.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a03f938a_7a5d_5807_a0d1_2128cedad674["doConnect()"]
  4080253b_1075_4ee4_570d_a7904062c2b8["Bootstrap"]
  a03f938a_7a5d_5807_a0d1_2128cedad674 -->|defined in| 4080253b_1075_4ee4_570d_a7904062c2b8
  dfddfff0_cb13_1601_2a46_f8a3506d4b72["ChannelFuture()"]
  dfddfff0_cb13_1601_2a46_f8a3506d4b72 -->|calls| a03f938a_7a5d_5807_a0d1_2128cedad674
  style a03f938a_7a5d_5807_a0d1_2128cedad674 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/main/java/io/netty/bootstrap/Bootstrap.java lines 248–265

    private static void doConnect(
            final SocketAddress remoteAddress, final SocketAddress localAddress, final ChannelPromise connectPromise) {

        // This method is invoked before channelRegistered() is triggered.  Give user handlers a chance to set up
        // the pipeline in its channelRegistered() implementation.
        final Channel channel = connectPromise.channel();
        channel.eventLoop().execute(new Runnable() {
            @Override
            public void run() {
                if (localAddress == null) {
                    channel.connect(remoteAddress, connectPromise);
                } else {
                    channel.connect(remoteAddress, localAddress, connectPromise);
                }
                connectPromise.addListener(ChannelFutureListener.CLOSE_ON_FAILURE);
            }
        });
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does doConnect() do?
doConnect() is a function in the netty codebase, defined in transport/src/main/java/io/netty/bootstrap/Bootstrap.java.
Where is doConnect() defined?
doConnect() is defined in transport/src/main/java/io/netty/bootstrap/Bootstrap.java at line 248.
What calls doConnect()?
doConnect() is called by 1 function(s): ChannelFuture.

Analyze Your Own Codebase

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

Try Supermodel Free