Home / Function/ Channel() — netty Function Reference

Channel() — netty Function Reference

Architecture documentation for the Channel() function in EpollDomainDatagramUnicastTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  7b3c2b79_3892_12a7_040f_433f2dc36517["Channel()"]
  9ed2c345_e09d_33a2_7f3a_1534eb6498ee["EpollDomainDatagramUnicastTest"]
  7b3c2b79_3892_12a7_040f_433f2dc36517 -->|defined in| 9ed2c345_e09d_33a2_7f3a_1534eb6498ee
  style 7b3c2b79_3892_12a7_040f_433f2dc36517 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollDomainDatagramUnicastTest.java lines 86–112

    @Override
    protected Channel setupClientChannel(Bootstrap cb, final byte[] bytes, final CountDownLatch latch,
                                         final AtomicReference<Throwable> errorRef) throws Throwable {
        cb.handler(new SimpleChannelInboundHandler<DomainDatagramPacket>() {

            @Override
            public void channelRead0(ChannelHandlerContext ctx, DomainDatagramPacket msg) {
                try {
                    ByteBuf buf = msg.content();
                    assertEquals(bytes.length, buf.readableBytes());
                    for (int i = 0; i < bytes.length; i++) {
                        assertEquals(bytes[i], buf.getByte(buf.readerIndex() + i));
                    }

                    assertEquals(ctx.channel().localAddress(), msg.recipient());
                } finally {
                    latch.countDown();
                }
            }

            @Override
            public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {
                errorRef.compareAndSet(null, cause);
            }
        });
        return cb.bind(newSocketAddress()).sync().channel();
    }

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free