Home / Function/ ExtendedHandle() — netty Function Reference

ExtendedHandle() — netty Function Reference

Architecture documentation for the ExtendedHandle() function in SocketAutoReadTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  58e067f6_7beb_7494_d777_32d328c00d52["ExtendedHandle()"]
  8d2b77bc_e9c8_21e1_78cc_3b09e651679b["TestRecvByteBufAllocator"]
  58e067f6_7beb_7494_d777_32d328c00d52 -->|defined in| 8d2b77bc_e9c8_21e1_78cc_3b09e651679b
  style 58e067f6_7beb_7494_d777_32d328c00d52 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketAutoReadTest.java lines 170–231

        @Override
        public ExtendedHandle newHandle() {
            return new ExtendedHandle() {
                private ChannelConfig config;
                private int attemptedBytesRead;
                private int lastBytesRead;
                @Override
                public ByteBuf allocate(ByteBufAllocator alloc) {
                    return alloc.ioBuffer(guess(), guess());
                }

                @Override
                public int guess() {
                    return 1; // only ever allocate buffers of size 1 to ensure the number of reads is controlled.
                }

                @Override
                public void reset(ChannelConfig config) {
                    this.config = config;
                }

                @Override
                public void incMessagesRead(int numMessages) {
                    // No need to track the number of messages read because it is not used.
                }

                @Override
                public void lastBytesRead(int bytes) {
                    lastBytesRead = bytes;
                }

                @Override
                public int lastBytesRead() {
                    return lastBytesRead;
                }

                @Override
                public void attemptedBytesRead(int bytes) {
                    attemptedBytesRead = bytes;
                }

                @Override
                public int attemptedBytesRead() {
                    return attemptedBytesRead;
                }

                @Override
                public boolean continueReading() {
                    return config.isAutoRead();
                }

                @Override
                public boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier) {
                    return config.isAutoRead();
                }

                @Override
                public void readComplete() {
                    // Nothing needs to be done or adjusted after each read cycle is completed.
                }
            };
        }

Domain

Subdomains

Frequently Asked Questions

What does ExtendedHandle() do?
ExtendedHandle() is a function in the netty codebase, defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketAutoReadTest.java.
Where is ExtendedHandle() defined?
ExtendedHandle() is defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketAutoReadTest.java at line 170.

Analyze Your Own Codebase

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

Try Supermodel Free