Home / Class/ SpliceInTask Class — netty Architecture

SpliceInTask Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  ad35b548_d8da_c31e_63a3_a0f12297957f["SpliceInTask"]
  70734405_31fd_71db_63bc_2114f3b39591["AbstractEpollStreamChannel.java"]
  ad35b548_d8da_c31e_63a3_a0f12297957f -->|defined in| 70734405_31fd_71db_63bc_2114f3b39591
  082ebb12_e63b_7bab_09f6_13563c83ca32["SpliceInTask()"]
  ad35b548_d8da_c31e_63a3_a0f12297957f -->|method| 082ebb12_e63b_7bab_09f6_13563c83ca32
  700d0ecb_1352_b044_4437_4fe399d26b18["spliceIn()"]
  ad35b548_d8da_c31e_63a3_a0f12297957f -->|method| 700d0ecb_1352_b044_4437_4fe399d26b18

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java lines 858–886

    protected abstract class SpliceInTask {
        final ChannelPromise promise;
        int len;

        protected SpliceInTask(int len, ChannelPromise promise) {
            this.promise = promise;
            this.len = len;
        }

        abstract boolean spliceIn(RecvByteBufAllocator.Handle handle);

        protected final int spliceIn(FileDescriptor pipeOut, RecvByteBufAllocator.Handle handle) throws IOException {
            // calculate the maximum amount of data we are allowed to splice
            int length = Math.min(handle.guess(), len);
            int splicedIn = 0;
            for (;;) {
                // Splicing until there is nothing left to splice.
                int localSplicedIn = Native.splice(socket.intValue(), -1, pipeOut.intValue(), -1, length);
                handle.lastBytesRead(localSplicedIn);
                if (localSplicedIn == 0) {
                    break;
                }
                splicedIn += localSplicedIn;
                length -= localSplicedIn;
            }

            return splicedIn;
        }
    }

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free