Home / Function/ doClose() — netty Function Reference

doClose() — netty Function Reference

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

Function java Buffer Search calls 2 called by 2

Entity Profile

Dependency Diagram

graph TD
  2baa241d_c24b_1b22_e723_0d15b4875e0f["doClose()"]
  6a1b1970_2eef_b28f_03e7_8b11508deece["AbstractEpollChannel"]
  2baa241d_c24b_1b22_e723_0d15b4875e0f -->|defined in| 6a1b1970_2eef_b28f_03e7_8b11508deece
  52a85ca8_dc57_c9e7_0ed9_ba388bf8b6bb["doDisconnect()"]
  52a85ca8_dc57_c9e7_0ed9_ba388bf8b6bb -->|calls| 2baa241d_c24b_1b22_e723_0d15b4875e0f
  a2aa9020_1497_44ac_ace1_8f2c0cb8fc3d["doConnect0()"]
  a2aa9020_1497_44ac_ace1_8f2c0cb8fc3d -->|calls| 2baa241d_c24b_1b22_e723_0d15b4875e0f
  7f5d7c20_f29b_4391_448f_c2f99ea5ea8f["doDeregister()"]
  2baa241d_c24b_1b22_e723_0d15b4875e0f -->|calls| 7f5d7c20_f29b_4391_448f_c2f99ea5ea8f
  d9ab1040_9ace_496a_a503_4d950b47fbce["close()"]
  2baa241d_c24b_1b22_e723_0d15b4875e0f -->|calls| d9ab1040_9ace_496a_a503_4d950b47fbce
  style 2baa241d_c24b_1b22_e723_0d15b4875e0f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollChannel.java lines 169–213

    @Override
    protected void doClose() throws Exception {
        active = false;
        // Even if we allow half closed sockets we should give up on reading. Otherwise we may allow a read attempt on a
        // socket which has not even been connected yet. This has been observed to block during unit tests.
        inputClosedSeenErrorOnRead = true;
        try {
            ChannelPromise promise = connectPromise;
            if (promise != null) {
                // Use tryFailure() instead of setFailure() to avoid the race against cancel().
                promise.tryFailure(new ClosedChannelException());
                connectPromise = null;
            }

            Future<?> future = connectTimeoutFuture;
            if (future != null) {
                future.cancel(false);
                connectTimeoutFuture = null;
            }

            if (isRegistered()) {
                // Need to check if we are on the EventLoop as doClose() may be triggered by the GlobalEventExecutor
                // if SO_LINGER is used.
                //
                // See https://github.com/netty/netty/issues/7159
                EventLoop loop = eventLoop();
                if (loop.inEventLoop()) {
                    doDeregister();
                } else {
                    loop.execute(new Runnable() {
                        @Override
                        public void run() {
                            try {
                                doDeregister();
                            } catch (Throwable cause) {
                                pipeline().fireExceptionCaught(cause);
                            }
                        }
                    });
                }
            }
        } finally {
            socket.close();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does doClose() do?
doClose() is a function in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollChannel.java.
Where is doClose() defined?
doClose() is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollChannel.java at line 169.
What does doClose() call?
doClose() calls 2 function(s): close, doDeregister.
What calls doClose()?
doClose() is called by 2 function(s): doConnect0, doDisconnect.

Analyze Your Own Codebase

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

Try Supermodel Free