Home / Function/ connect() — netty Function Reference

connect() — netty Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  7e80158a_cf94_6da4_b231_e5219a9c7477["connect()"]
  33481830_4009_3b9e_d4c5_d0070d36ff1a["DynamicAddressConnectHandler"]
  7e80158a_cf94_6da4_b231_e5219a9c7477 -->|defined in| 33481830_4009_3b9e_d4c5_d0070d36ff1a
  style 7e80158a_cf94_6da4_b231_e5219a9c7477 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

handler/src/main/java/io/netty/handler/address/DynamicAddressConnectHandler.java lines 35–54

    @Override
    public final void connect(ChannelHandlerContext ctx, SocketAddress remoteAddress,
                              SocketAddress localAddress, ChannelPromise promise) {
        final SocketAddress remote;
        final SocketAddress local;
        try {
            remote = remoteAddress(remoteAddress, localAddress);
            local = localAddress(remoteAddress, localAddress);
        } catch (Exception e) {
            promise.setFailure(e);
            return;
        }
        ctx.connect(remote, local, promise).addListener(future -> {
            if (future.isSuccess()) {
                // We only remove this handler from the pipeline once the connect was successful as otherwise
                // the user may try to connect again.
                ctx.pipeline().remove(DynamicAddressConnectHandler.this);
            }
        });
    }

Domain

Subdomains

Frequently Asked Questions

What does connect() do?
connect() is a function in the netty codebase, defined in handler/src/main/java/io/netty/handler/address/DynamicAddressConnectHandler.java.
Where is connect() defined?
connect() is defined in handler/src/main/java/io/netty/handler/address/DynamicAddressConnectHandler.java at line 35.

Analyze Your Own Codebase

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

Try Supermodel Free