Home / Class/ DefaultOioUnsafe Class — netty Architecture

DefaultOioUnsafe Class — netty Architecture

Architecture documentation for the DefaultOioUnsafe class in AbstractOioChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  1adb1602_1747_0e17_60a4_9ff33e43586f["DefaultOioUnsafe"]
  68fab966_c528_5d24_5bc9_959bcb2e6568["AbstractOioChannel.java"]
  1adb1602_1747_0e17_60a4_9ff33e43586f -->|defined in| 68fab966_c528_5d24_5bc9_959bcb2e6568
  98234df0_5e69_0926_a309_1621df1ac44d["connect()"]
  1adb1602_1747_0e17_60a4_9ff33e43586f -->|method| 98234df0_5e69_0926_a309_1621df1ac44d

Relationship Graph

Source Code

transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java lines 63–89

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

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

                // Get the state as trySuccess() may trigger an ChannelFutureListener that will close the Channel.
                // We still need to ensure we call fireChannelActive() in this case.
                boolean active = isActive();

                safeSetSuccess(promise);
                if (!wasActive && active) {
                    pipeline().fireChannelActive();
                }
            } catch (Throwable t) {
                safeSetFailure(promise, annotateConnectException(t, remoteAddress));
                closeIfClosed();
            }
        }
    }

Frequently Asked Questions

What is the DefaultOioUnsafe class?
DefaultOioUnsafe is a class in the netty codebase, defined in transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java.
Where is DefaultOioUnsafe defined?
DefaultOioUnsafe is defined in transport/src/main/java/io/netty/channel/oio/AbstractOioChannel.java at line 63.

Analyze Your Own Codebase

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

Try Supermodel Free