Home / Function/ epollInReady() — netty Function Reference

epollInReady() — netty Function Reference

Architecture documentation for the epollInReady() function in AbstractEpollServerChannel.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  c8a4d77a_691c_a46b_5154_b2e603435216["epollInReady()"]
  a777fbd3_8623_9136_b37a_d54e5a77a917["EpollServerSocketUnsafe"]
  c8a4d77a_691c_a46b_5154_b2e603435216 -->|defined in| a777fbd3_8623_9136_b37a_d54e5a77a917
  style c8a4d77a_691c_a46b_5154_b2e603435216 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollServerChannel.java lines 82–127

        @Override
        void epollInReady() {
            assert eventLoop().inEventLoop();
            final ChannelConfig config = config();
            if (shouldBreakEpollInReady(config)) {
                clearEpollIn0();
                return;
            }
            final EpollRecvByteAllocatorHandle allocHandle = recvBufAllocHandle();
            final ChannelPipeline pipeline = pipeline();
            allocHandle.reset(config);
            allocHandle.attemptedBytesRead(1);

            Throwable exception = null;
            try {
                try {
                    do {
                        // lastBytesRead represents the fd. We use lastBytesRead because it must be set so that the
                        // EpollRecvByteAllocatorHandle knows if it should try to read again or not when autoRead is
                        // enabled.
                        allocHandle.lastBytesRead(socket.accept(acceptedAddress));
                        if (allocHandle.lastBytesRead() == -1) {
                            // this means everything was handled for now
                            break;
                        }
                        allocHandle.incMessagesRead(1);

                        readPending = false;
                        pipeline.fireChannelRead(newChildChannel(allocHandle.lastBytesRead(), acceptedAddress, 1,
                                                                 acceptedAddress[0]));
                    } while (allocHandle.continueReading());
                } catch (Throwable t) {
                    exception = t;
                }
                allocHandle.readComplete();
                pipeline.fireChannelReadComplete();

                if (exception != null) {
                    pipeline.fireExceptionCaught(exception);
                }
            } finally {
                if (shouldStopReading(config)) {
                    clearEpollIn();
                }
            }
        }

Domain

Subdomains

Frequently Asked Questions

What does epollInReady() do?
epollInReady() is a function in the netty codebase, defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollServerChannel.java.
Where is epollInReady() defined?
epollInReady() is defined in transport-classes-epoll/src/main/java/io/netty/channel/epoll/AbstractEpollServerChannel.java at line 82.

Analyze Your Own Codebase

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

Try Supermodel Free