Home / Function/ spliceIn() — netty Function Reference

spliceIn() — netty Function Reference

Architecture documentation for the spliceIn() function in AbstractEpollStreamChannel.java from the netty codebase.

Function java Buffer Search calls 2 called by 1

Entity Profile

Dependency Diagram

graph TD
  2d4cd98e_9464_bc0c_02b4_94166b830478["spliceIn()"]
  6f5c6f08_1102_30ab_f45d_612a94bd5756["SpliceFdTask"]
  2d4cd98e_9464_bc0c_02b4_94166b830478 -->|defined in| 6f5c6f08_1102_30ab_f45d_612a94bd5756
  700d0ecb_1352_b044_4437_4fe399d26b18["spliceIn()"]
  700d0ecb_1352_b044_4437_4fe399d26b18 -->|calls| 2d4cd98e_9464_bc0c_02b4_94166b830478
  e2850537_739b_b2d1_0e86_0c9475219558["safeClosePipe()"]
  2d4cd98e_9464_bc0c_02b4_94166b830478 -->|calls| e2850537_739b_b2d1_0e86_0c9475219558
  700d0ecb_1352_b044_4437_4fe399d26b18["spliceIn()"]
  2d4cd98e_9464_bc0c_02b4_94166b830478 -->|calls| 700d0ecb_1352_b044_4437_4fe399d26b18
  style 2d4cd98e_9464_bc0c_02b4_94166b830478 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java lines 1011–1052

        @Override
        public boolean spliceIn(RecvByteBufAllocator.Handle handle) {
            assert eventLoop().inEventLoop();
            if (len == 0) {
                // Use trySuccess() as the promise might already be failed by spliceTo(...)
                promise.trySuccess();
                return true;
            }

            try {
                FileDescriptor[] pipe = pipe();
                FileDescriptor pipeIn = pipe[0];
                FileDescriptor pipeOut = pipe[1];
                try {
                    int splicedIn = spliceIn(pipeOut, handle);
                    if (splicedIn > 0) {
                        // Integer.MAX_VALUE is a special value which will result in splice forever.
                        if (len != Integer.MAX_VALUE) {
                            len -= splicedIn;
                        }
                        do {
                            int splicedOut = Native.splice(pipeIn.intValue(), -1, fd.intValue(), offset, splicedIn);
                            offset += splicedOut;
                            splicedIn -= splicedOut;
                        } while (splicedIn > 0);
                        if (len == 0) {
                            // Use trySuccess() as the promise might already be failed by spliceTo(...)
                            promise.trySuccess();
                            return true;
                        }
                    }
                    return false;
                } finally {
                    safeClosePipe(pipeIn);
                    safeClosePipe(pipeOut);
                }
            } catch (Throwable cause) {
                // Use tryFailure(...) as the promise might already be failed by spliceTo(...)
                promise.tryFailure(cause);
                return true;
            }
        }

Domain

Subdomains

Called By

Frequently Asked Questions

What does spliceIn() do?
spliceIn() is a function in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java.
Where is spliceIn() defined?
spliceIn() is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollStreamChannel.java at line 1011.
What does spliceIn() call?
spliceIn() calls 2 function(s): safeClosePipe, spliceIn.
What calls spliceIn()?
spliceIn() is called by 1 function(s): spliceIn.

Analyze Your Own Codebase

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

Try Supermodel Free