Home / Function/ failConnectPromise() — netty Function Reference

failConnectPromise() — netty Function Reference

Architecture documentation for the failConnectPromise() function in AbstractKQueueChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  d2ea9046_f7dc_694b_b7a7_9bc6720f94be["failConnectPromise()"]
  db95214c_090e_b762_6cfd_37721de6cf7b["AbstractKQueueUnsafe"]
  d2ea9046_f7dc_694b_b7a7_9bc6720f94be -->|defined in| db95214c_090e_b762_6cfd_37721de6cf7b
  style d2ea9046_f7dc_694b_b7a7_9bc6720f94be fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java lines 432–446

        final boolean failConnectPromise(Throwable cause) {
            if (connectPromise != null) {
                // SO_ERROR has been shown to return 0 on macOS if detect an error via read() and the write filter was
                // not set before calling connect. This means finishConnect will not detect any error and would
                // successfully complete the connectPromise and update the channel state to active (which is incorrect).
                ChannelPromise connectPromise = AbstractKQueueChannel.this.connectPromise;
                AbstractKQueueChannel.this.connectPromise = null;
                if (connectPromise.tryFailure((cause instanceof ConnectException) ? cause
                                : new ConnectException("failed to connect").initCause(cause))) {
                    closeIfClosed();
                    return true;
                }
            }
            return false;
        }

Domain

Subdomains

Frequently Asked Questions

What does failConnectPromise() do?
failConnectPromise() is a function in the netty codebase, defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java.
Where is failConnectPromise() defined?
failConnectPromise() is defined in transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/AbstractKQueueChannel.java at line 432.

Analyze Your Own Codebase

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

Try Supermodel Free