Home / Function/ testResultNoTimeoutCorrectlyEncoded() — netty Function Reference

testResultNoTimeoutCorrectlyEncoded() — netty Function Reference

Architecture documentation for the testResultNoTimeoutCorrectlyEncoded() function in EpollEventLoopTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  f16230fe_0636_eb5d_927c_baa1dea3fec4["testResultNoTimeoutCorrectlyEncoded()"]
  bfe6ddcc_7826_010d_3f8f_df4f5668832e["EpollEventLoopTest"]
  f16230fe_0636_eb5d_927c_baa1dea3fec4 -->|defined in| bfe6ddcc_7826_010d_3f8f_df4f5668832e
  style f16230fe_0636_eb5d_927c_baa1dea3fec4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollEventLoopTest.java lines 150–193

    @Test
    public void testResultNoTimeoutCorrectlyEncoded() throws Throwable {
        final FileDescriptor epoll = Native.newEpollCreate();
        final FileDescriptor eventFd = Native.newEventFd();
        final FileDescriptor timerFd = Native.newTimerFd();
        final EpollEventArray array = new EpollEventArray(1024);
        try {
            Native.epollCtlAdd(epoll.intValue(), eventFd.intValue(), Native.EPOLLIN | Native.EPOLLET);
            final AtomicReference<Throwable> causeRef = new AtomicReference<Throwable>();
            final Thread t = new Thread(new Runnable() {
                @Override
                public void run() {
                    try {
                        for (;;) {
                            long ready = Native.epollWait(epoll, array, timerFd, 0, 0, 10);
                            if (ready > 0) {
                                assertEquals(1, Native.epollReady(ready));
                                assertEquals(eventFd.intValue(), array.fd(0));
                                return;
                            }
                            Thread.sleep(100);
                        }
                    } catch (IOException e) {
                        causeRef.set(e);
                    } catch (InterruptedException ignore) {
                        // ignore
                    }
                }
            });
            t.start();
            Native.eventFdWrite(eventFd.intValue(), 1);

            t.join();
            Throwable cause = causeRef.get();
            if (cause != null) {
                throw cause;
            }
        } finally {
            array.free();
            epoll.close();
            eventFd.close();
            timerFd.close();
        }
    }

Domain

Subdomains

Frequently Asked Questions

What does testResultNoTimeoutCorrectlyEncoded() do?
testResultNoTimeoutCorrectlyEncoded() is a function in the netty codebase, defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollEventLoopTest.java.
Where is testResultNoTimeoutCorrectlyEncoded() defined?
testResultNoTimeoutCorrectlyEncoded() is defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollEventLoopTest.java at line 150.

Analyze Your Own Codebase

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

Try Supermodel Free