Home / Class/ AbstractEpollStreamChannel Class — netty Architecture

AbstractEpollStreamChannel Class — netty Architecture

Architecture documentation for the AbstractEpollStreamChannel class in AbstractEpollStreamChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  6ec314cd_b42f_72bd_344b_f54212398142["AbstractEpollStreamChannel"]
  70734405_31fd_71db_63bc_2114f3b39591["AbstractEpollStreamChannel.java"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|defined in| 70734405_31fd_71db_63bc_2114f3b39591
  5a176dd8_c505_9231_1f38_8488f832b476["AbstractEpollStreamChannel()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 5a176dd8_c505_9231_1f38_8488f832b476
  218bf2d5_a9e8_297b_d008_74eabd2f7cbc["AbstractEpollUnsafe()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 218bf2d5_a9e8_297b_d008_74eabd2f7cbc
  dd5a455c_bc8a_34a3_835c_06bdc818fcd9["ChannelMetadata()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| dd5a455c_bc8a_34a3_835c_06bdc818fcd9
  5a972d14_e636_b2d4_6755_e61146b73433["ChannelFuture()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 5a972d14_e636_b2d4_6755_e61146b73433
  9018916a_ad69_8dc8_7d33_1de39ca95b1c["failSpliceIfClosed()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 9018916a_ad69_8dc8_7d33_1de39ca95b1c
  acf08ba5_a28e_b6ac_a850_5e45694f7cbc["writeBytes()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| acf08ba5_a28e_b6ac_a850_5e45694f7cbc
  33481a97_2b4d_55aa_8999_b11ea1a94b03["adjustMaxBytesPerGatheringWrite()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 33481a97_2b4d_55aa_8999_b11ea1a94b03
  a5dc69a3_d29e_d4a5_1eb0_e9fdb99b443e["writeBytesMultiple()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| a5dc69a3_d29e_d4a5_1eb0_e9fdb99b443e
  0e7f51f8_c937_1144_8e27_7b7e8948d1de["writeDefaultFileRegion()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 0e7f51f8_c937_1144_8e27_7b7e8948d1de
  04d32e0e_cc03_d646_afd2_18a4a4db196c["writeFileRegion()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 04d32e0e_cc03_d646_afd2_18a4a4db196c
  45b68c03_a456_a0b0_0f4a_03ba140e0340["doWrite()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 45b68c03_a456_a0b0_0f4a_03ba140e0340
  6f923dac_2ab4_45b4_f2b7_ac945384fb3c["doWriteSingle()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| 6f923dac_2ab4_45b4_f2b7_ac945384fb3c
  f600792f_4dbb_bbbf_2f55_5060e177423d["doWriteMultiple()"]
  6ec314cd_b42f_72bd_344b_f54212398142 -->|method| f600792f_4dbb_bbbf_2f55_5060e177423d

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java lines 59–1071

public abstract class AbstractEpollStreamChannel extends AbstractEpollChannel implements DuplexChannel {
    private static final ChannelMetadata METADATA = new ChannelMetadata(false, 16);
    private static final String EXPECTED_TYPES =
            " (expected: " + StringUtil.simpleClassName(ByteBuf.class) + ", " +
                    StringUtil.simpleClassName(DefaultFileRegion.class) + ')';
    private static final InternalLogger logger = InternalLoggerFactory.getInstance(AbstractEpollStreamChannel.class);

    private final Runnable flushTask = new Runnable() {
        @Override
        public void run() {
            // Calling flush0 directly to ensure we not try to flush messages that were added via write(...) in the
            // meantime.
            ((AbstractEpollUnsafe) unsafe()).flush0();
        }
    };

    // Lazy init these if we need to splice(...)
    private volatile Queue<SpliceInTask> spliceQueue;
    private FileDescriptor pipeIn;
    private FileDescriptor pipeOut;

    private WritableByteChannel byteChannel;

    protected AbstractEpollStreamChannel(Channel parent, int fd) {
        this(parent, new LinuxSocket(fd));
    }

    protected AbstractEpollStreamChannel(int fd) {
        this(new LinuxSocket(fd));
    }

    AbstractEpollStreamChannel(LinuxSocket fd) {
        this(fd, isSoErrorZero(fd));
    }

    AbstractEpollStreamChannel(Channel parent, LinuxSocket fd) {
        // Add EPOLLRDHUP so we are notified once the remote peer close the connection.
        super(parent, fd, true, EpollIoOps.EPOLLRDHUP);
    }

    protected AbstractEpollStreamChannel(Channel parent, LinuxSocket fd, SocketAddress remote) {
        // Add EPOLLRDHUP so we are notified once the remote peer close the connection.
        super(parent, fd, remote, EpollIoOps.EPOLLRDHUP);
    }

    protected AbstractEpollStreamChannel(LinuxSocket fd, boolean active) {
        // Add EPOLLRDHUP so we are notified once the remote peer close the connection.
        super(null, fd, active, EpollIoOps.EPOLLRDHUP);
    }

    @Override
    protected AbstractEpollUnsafe newUnsafe() {
        return new EpollStreamUnsafe();
    }

    @Override
    public ChannelMetadata metadata() {
        return METADATA;
    }

    /**
     * Splice from this {@link AbstractEpollStreamChannel} to another {@link AbstractEpollStreamChannel}.
     * The {@code len} is the number of bytes to splice. If using {@link Integer#MAX_VALUE} it will
     * splice until the {@link ChannelFuture} was canceled or it was failed.
     *
     * Please note:
     * <ul>
     *   <li>both channels need to be registered to the same {@link EventLoop}, otherwise an
     *   {@link IllegalArgumentException} is thrown. </li>
     *   <li>{@link EpollChannelConfig#getEpollMode()} must be {@link EpollMode#LEVEL_TRIGGERED} for this and the
     *   target {@link AbstractEpollStreamChannel}</li>
     * </ul>
     * @deprecated Will be removed in the future.
     */
    @Deprecated
    public final ChannelFuture spliceTo(final AbstractEpollStreamChannel ch, final int len) {
        return spliceTo(ch, len, newPromise());
    }

    /**
     * Splice from this {@link AbstractEpollStreamChannel} to another {@link AbstractEpollStreamChannel}.

Frequently Asked Questions

What is the AbstractEpollStreamChannel class?
AbstractEpollStreamChannel is a class in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java.
Where is AbstractEpollStreamChannel defined?
AbstractEpollStreamChannel is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java at line 59.

Analyze Your Own Codebase

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

Try Supermodel Free