Home / Class/ SctpLimitStreamsTest Class — netty Architecture

SctpLimitStreamsTest Class — netty Architecture

Architecture documentation for the SctpLimitStreamsTest class in SctpLimitStreamsTest.java from the netty codebase.

Entity Profile

Dependency Diagram

graph TD
  7043bbe2_d1e5_54a7_ebdb_152b39688a90["SctpLimitStreamsTest"]
  047ac3e0_9d49_8993_6d75_ebb91112479b["SctpLimitStreamsTest.java"]
  7043bbe2_d1e5_54a7_ebdb_152b39688a90 -->|defined in| 047ac3e0_9d49_8993_6d75_ebb91112479b
  34a71770_a844_ad19_3712_bde0bc3ff063["checkSupported()"]
  7043bbe2_d1e5_54a7_ebdb_152b39688a90 -->|method| 34a71770_a844_ad19_3712_bde0bc3ff063
  45dcd3b1_29eb_db0b_1477_4708ebd29114["testSctpInitMaxstreams()"]
  7043bbe2_d1e5_54a7_ebdb_152b39688a90 -->|method| 45dcd3b1_29eb_db0b_1477_4708ebd29114
  50422a2c_9d61_d720_4739_ef68b1de56a8["EventLoopGroup()"]
  7043bbe2_d1e5_54a7_ebdb_152b39688a90 -->|method| 50422a2c_9d61_d720_4739_ef68b1de56a8
  e5490020_3822_091b_0f3e_2b6a0a01404b["clientClass()"]
  7043bbe2_d1e5_54a7_ebdb_152b39688a90 -->|method| e5490020_3822_091b_0f3e_2b6a0a01404b
  a5ff5be1_7448_5ff7_3dff_ab27a212825b["serverClass()"]
  7043bbe2_d1e5_54a7_ebdb_152b39688a90 -->|method| a5ff5be1_7448_5ff7_3dff_ab27a212825b

Relationship Graph

Source Code

transport-sctp/src/test/java/io/netty/channel/sctp/SctpLimitStreamsTest.java lines 37–82

public abstract class SctpLimitStreamsTest {

    @BeforeAll
    public static void checkSupported() {
        assumeTrue(SctpTestUtil.isSctpSupported());
    }

    @SuppressForbidden(reason = "test-only")
    @Test
    @Timeout(value = 5000, unit = TimeUnit.MILLISECONDS)
    public void testSctpInitMaxstreams() throws Exception {
        EventLoopGroup loop = newEventLoopGroup();
        try {
            ServerBootstrap serverBootstrap = new ServerBootstrap();
            serverBootstrap.group(loop)
                    .channel(serverClass())
                    .option(ChannelOption.SO_REUSEADDR, true)
                    .option(SctpChannelOption.SCTP_INIT_MAXSTREAMS,
                            SctpStandardSocketOptions.InitMaxStreams.create(1, 1))
                    .localAddress(new InetSocketAddress(0))
                    .childHandler(new ChannelInboundHandlerAdapter());

            Bootstrap clientBootstrap = new Bootstrap()
                    .group(loop)
                    .channel(clientClass())
                    .option(SctpChannelOption.SCTP_INIT_MAXSTREAMS,
                            SctpStandardSocketOptions.InitMaxStreams.create(112, 112))
                    .handler(new ChannelInboundHandlerAdapter());

            Channel serverChannel = serverBootstrap.bind()
                    .syncUninterruptibly().channel();
            SctpChannel clientChannel = (SctpChannel) clientBootstrap.connect(serverChannel.localAddress())
                    .syncUninterruptibly().channel();
            assertEquals(1, clientChannel.association().maxOutboundStreams());
            assertEquals(1, clientChannel.association().maxInboundStreams());
            serverChannel.close().syncUninterruptibly();
            clientChannel.close().syncUninterruptibly();
        } finally {
            loop.shutdownGracefully();
        }
    }

    protected abstract EventLoopGroup newEventLoopGroup();
    protected abstract Class<? extends SctpChannel> clientClass();
    protected abstract Class<? extends SctpServerChannel> serverClass();
}

Frequently Asked Questions

What is the SctpLimitStreamsTest class?
SctpLimitStreamsTest is a class in the netty codebase, defined in transport-sctp/src/test/java/io/netty/channel/sctp/SctpLimitStreamsTest.java.
Where is SctpLimitStreamsTest defined?
SctpLimitStreamsTest is defined in transport-sctp/src/test/java/io/netty/channel/sctp/SctpLimitStreamsTest.java at line 37.

Analyze Your Own Codebase

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

Try Supermodel Free