Home / Function/ testTooManyClientChannels() — netty Function Reference

testTooManyClientChannels() — netty Function Reference

Architecture documentation for the testTooManyClientChannels() function in OioEventLoopTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  06009fe4_ec47_85ba_f107_ac2fb00423dc["testTooManyClientChannels()"]
  014786d9_6185_4241_3f9d_b335998e5758["OioEventLoopTest"]
  06009fe4_ec47_85ba_f107_ac2fb00423dc -->|defined in| 014786d9_6185_4241_3f9d_b335998e5758
  style 06009fe4_ec47_85ba_f107_ac2fb00423dc fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport/src/test/java/io/netty/channel/oio/OioEventLoopTest.java lines 68–98

    @Test
    public void testTooManyClientChannels() throws Exception {
        EventLoopGroup g = new OioEventLoopGroup(1);
        ServerBootstrap sb = new ServerBootstrap();
        sb.channel(OioServerSocketChannel.class);
        sb.group(g);
        sb.childHandler(new ChannelInboundHandlerAdapter());
        ChannelFuture f1 = sb.bind(0);
        f1.sync();

        Bootstrap cb = new Bootstrap();
        cb.channel(OioSocketChannel.class);
        cb.group(g);
        cb.handler(new ChannelInboundHandlerAdapter());
        ChannelFuture f2 = cb.connect(NetUtil.LOCALHOST, ((InetSocketAddress) f1.channel().localAddress()).getPort());
        f2.await();

        assertInstanceOf(ChannelException.class, f2.cause());
        assertThat(f2.cause().getMessage().toLowerCase()).contains("too many channels");

        final CountDownLatch notified = new CountDownLatch(1);
        f2.addListener(new ChannelFutureListener() {
            @Override
            public void operationComplete(ChannelFuture future) throws Exception {
                notified.countDown();
            }
        });

        notified.await();
        g.shutdownGracefully();
    }

Domain

Subdomains

Frequently Asked Questions

What does testTooManyClientChannels() do?
testTooManyClientChannels() is a function in the netty codebase, defined in transport/src/test/java/io/netty/channel/oio/OioEventLoopTest.java.
Where is testTooManyClientChannels() defined?
testTooManyClientChannels() is defined in transport/src/test/java/io/netty/channel/oio/OioEventLoopTest.java at line 68.

Analyze Your Own Codebase

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

Try Supermodel Free