Home / Function/ testMultipleBindSocketChannel() — netty Function Reference

testMultipleBindSocketChannel() — netty Function Reference

Architecture documentation for the testMultipleBindSocketChannel() function in EpollReuseAddrTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  a01a7156_56b9_340b_9199_4950aa101ca9["testMultipleBindSocketChannel()"]
  872e58d8_72a4_04f4_f4a3_a86fb110f538["EpollReuseAddrTest"]
  a01a7156_56b9_340b_9199_4950aa101ca9 -->|defined in| 872e58d8_72a4_04f4_f4a3_a86fb110f538
  2cb5d0a8_8e51_b815_9f07_7fbf35f11bf5["versionEqOrGt()"]
  a01a7156_56b9_340b_9199_4950aa101ca9 -->|calls| 2cb5d0a8_8e51_b815_9f07_7fbf35f11bf5
  01335c1c_a7c4_46a2_3db4_72e2f170f465["ServerSocketTestHandler()"]
  a01a7156_56b9_340b_9199_4950aa101ca9 -->|calls| 01335c1c_a7c4_46a2_3db4_72e2f170f465
  style a01a7156_56b9_340b_9199_4950aa101ca9 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollReuseAddrTest.java lines 116–140

    @Test
    @Timeout(value = 10000, unit = TimeUnit.MILLISECONDS)
    public void testMultipleBindSocketChannel() throws Exception {
        assumeTrue(versionEqOrGt(3, 9, 0));
        ServerBootstrap bootstrap = createServerBootstrap();
        bootstrap.option(EpollChannelOption.SO_REUSEPORT, true);
        final AtomicBoolean accepted1 = new AtomicBoolean();
        bootstrap.childHandler(new ServerSocketTestHandler(accepted1));
        ChannelFuture future = bootstrap.bind().syncUninterruptibly();
        InetSocketAddress address1 = (InetSocketAddress) future.channel().localAddress();

        final AtomicBoolean accepted2 = new AtomicBoolean();
        bootstrap.childHandler(new ServerSocketTestHandler(accepted2));
        ChannelFuture future2 = bootstrap.bind(address1).syncUninterruptibly();
        InetSocketAddress address2 = (InetSocketAddress) future2.channel().localAddress();

        assertEquals(address1, address2);
        while (!accepted1.get() || !accepted2.get()) {
            Socket socket = new Socket(address1.getAddress(), address1.getPort());
            socket.setReuseAddress(true);
            socket.close();
        }
        future.channel().close().syncUninterruptibly();
        future2.channel().close().syncUninterruptibly();
    }

Domain

Subdomains

Frequently Asked Questions

What does testMultipleBindSocketChannel() do?
testMultipleBindSocketChannel() is a function in the netty codebase, defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollReuseAddrTest.java.
Where is testMultipleBindSocketChannel() defined?
testMultipleBindSocketChannel() is defined in transport-native-epoll/src/test/java/io/netty/channel/epoll/EpollReuseAddrTest.java at line 116.
What does testMultipleBindSocketChannel() call?
testMultipleBindSocketChannel() calls 2 function(s): ServerSocketTestHandler, versionEqOrGt.

Analyze Your Own Codebase

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

Try Supermodel Free