Home / Function/ doConnect() — netty Function Reference

doConnect() — netty Function Reference

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

Function java Buffer Telemetry calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  787d0c0e_2985_8740_e71f_9ea9fb74d805["doConnect()"]
  6a1b1970_2eef_b28f_03e7_8b11508deece["AbstractEpollChannel"]
  787d0c0e_2985_8740_e71f_9ea9fb74d805 -->|defined in| 6a1b1970_2eef_b28f_03e7_8b11508deece
  de296ec8_0585_b2e9_10fb_e6fbdd21f16f["connect()"]
  de296ec8_0585_b2e9_10fb_e6fbdd21f16f -->|calls| 787d0c0e_2985_8740_e71f_9ea9fb74d805
  ae19abf5_3a32_4cde_48b3_c6a74b0089ea["checkResolvable()"]
  787d0c0e_2985_8740_e71f_9ea9fb74d805 -->|calls| ae19abf5_3a32_4cde_48b3_c6a74b0089ea
  de296ec8_0585_b2e9_10fb_e6fbdd21f16f["connect()"]
  787d0c0e_2985_8740_e71f_9ea9fb74d805 -->|calls| de296ec8_0585_b2e9_10fb_e6fbdd21f16f
  a2aa9020_1497_44ac_ace1_8f2c0cb8fc3d["doConnect0()"]
  787d0c0e_2985_8740_e71f_9ea9fb74d805 -->|calls| a2aa9020_1497_44ac_ace1_8f2c0cb8fc3d
  style 787d0c0e_2985_8740_e71f_9ea9fb74d805 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollChannel.java lines 790–822

    protected boolean doConnect(SocketAddress remoteAddress, SocketAddress localAddress) throws Exception {
        if (localAddress instanceof InetSocketAddress) {
            checkResolvable((InetSocketAddress) localAddress);
        }

        InetSocketAddress remoteSocketAddr = remoteAddress instanceof InetSocketAddress
                ? (InetSocketAddress) remoteAddress : null;
        if (remoteSocketAddr != null) {
            checkResolvable(remoteSocketAddr);
        }

        if (remote != null) {
            // Check if already connected before trying to connect. This is needed as connect(...) will not return -1
            // and set errno to EISCONN if a previous connect(...) attempt was setting errno to EINPROGRESS and finished
            // later.
            throw new AlreadyConnectedException();
        }

        if (localAddress != null) {
            socket.bind(localAddress);
        }

        boolean connected = doConnect0(remoteAddress);
        if (connected) {
            remote = remoteSocketAddr == null ?
                    remoteAddress : computeRemoteAddr(remoteSocketAddr, socket.remoteAddress());
        }
        // We always need to set the localAddress even if not connected yet as the bind already took place.
        //
        // See https://github.com/netty/netty/issues/3463
        local = socket.localAddress();
        return connected;
    }

Domain

Subdomains

Called By

Frequently Asked Questions

What does doConnect() do?
doConnect() is a function in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollChannel.java.
Where is doConnect() defined?
doConnect() is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollChannel.java at line 790.
What does doConnect() call?
doConnect() calls 3 function(s): checkResolvable, connect, doConnect0.
What calls doConnect()?
doConnect() is called by 1 function(s): connect.

Analyze Your Own Codebase

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

Try Supermodel Free