Home / Function/ connect() — netty Function Reference

connect() — netty Function Reference

Architecture documentation for the connect() function in RxtxChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  00581f20_0dcc_c5da_cef6_8b4ae5a2b485["connect()"]
  9f111b14_1674_16a9_19ce_6d3150be2298["RxtxUnsafe"]
  00581f20_0dcc_c5da_cef6_8b4ae5a2b485 -->|defined in| 9f111b14_1674_16a9_19ce_6d3150be2298
  8a8f51ff_76fc_be17_20c2_37f9dc65371f["doConnect()"]
  00581f20_0dcc_c5da_cef6_8b4ae5a2b485 -->|calls| 8a8f51ff_76fc_be17_20c2_37f9dc65371f
  2490054d_3322_de70_5342_182d92e5ee66["doInit()"]
  00581f20_0dcc_c5da_cef6_8b4ae5a2b485 -->|calls| 2490054d_3322_de70_5342_182d92e5ee66
  style 00581f20_0dcc_c5da_cef6_8b4ae5a2b485 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannel.java lines 153–193

        @Override
        public void connect(
                final SocketAddress remoteAddress,
                final SocketAddress localAddress, final ChannelPromise promise) {
            if (!promise.setUncancellable() || !ensureOpen(promise)) {
                return;
            }

            try {
                final boolean wasActive = isActive();
                doConnect(remoteAddress, localAddress);

                int waitTime = config().getOption(WAIT_TIME);
                if (waitTime > 0) {
                    eventLoop().schedule(new Runnable() {
                        @Override
                        public void run() {
                            try {
                                doInit();
                                safeSetSuccess(promise);
                                if (!wasActive && isActive()) {
                                    pipeline().fireChannelActive();
                                }
                            } catch (Throwable t) {
                                safeSetFailure(promise, t);
                                closeIfClosed();
                            }
                        }
                   }, waitTime, TimeUnit.MILLISECONDS);
                } else {
                    doInit();
                    safeSetSuccess(promise);
                    if (!wasActive && isActive()) {
                        pipeline().fireChannelActive();
                    }
                }
            } catch (Throwable t) {
                safeSetFailure(promise, t);
                closeIfClosed();
            }
        }

Domain

Subdomains

Frequently Asked Questions

What does connect() do?
connect() is a function in the netty codebase, defined in transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannel.java.
Where is connect() defined?
connect() is defined in transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannel.java at line 153.
What does connect() call?
connect() calls 2 function(s): doConnect, doInit.

Analyze Your Own Codebase

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

Try Supermodel Free