Home / Class/ SocketCloseForciblyTest Class — netty Architecture

SocketCloseForciblyTest Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  39ff6cf9_9af2_0249_41bc_ad9d9d5e2fb9["SocketCloseForciblyTest"]
  90190f84_6f48_ac9c_000e_589281d18533["SocketCloseForciblyTest.java"]
  39ff6cf9_9af2_0249_41bc_ad9d9d5e2fb9 -->|defined in| 90190f84_6f48_ac9c_000e_589281d18533
  c4b98169_dc0e_b1fc_0743_e5e698bebd83["testCloseForcibly()"]
  39ff6cf9_9af2_0249_41bc_ad9d9d5e2fb9 -->|method| c4b98169_dc0e_b1fc_0743_e5e698bebd83

Relationship Graph

Source Code

testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketCloseForciblyTest.java lines 27–56

public class SocketCloseForciblyTest extends AbstractSocketTest {

    @Test
    public void testCloseForcibly(TestInfo testInfo) throws Throwable {
        run(testInfo, new Runner<ServerBootstrap, Bootstrap>() {
            @Override
            public void run(ServerBootstrap serverBootstrap, Bootstrap bootstrap) throws Throwable {
                testCloseForcibly(serverBootstrap, bootstrap);
            }
        });
    }

    public void testCloseForcibly(ServerBootstrap sb, Bootstrap cb) throws Throwable {
        sb.handler(new ChannelInboundHandlerAdapter() {
            @Override
            public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception {
                SocketChannel childChannel = (SocketChannel) msg;
                childChannel.config().setSoLinger(0);
                childChannel.unsafe().closeForcibly();
            }
        }).childHandler(new ChannelInboundHandlerAdapter());

        cb.handler(new ChannelInboundHandlerAdapter());

        Channel sc = sb.bind().sync().channel();

        cb.connect(sc.localAddress()).channel().closeFuture().syncUninterruptibly();
        sc.close().sync();
    }
}

Frequently Asked Questions

What is the SocketCloseForciblyTest class?
SocketCloseForciblyTest is a class in the netty codebase, defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketCloseForciblyTest.java.
Where is SocketCloseForciblyTest defined?
SocketCloseForciblyTest is defined in testsuite/src/main/java/io/netty/testsuite/transport/socket/SocketCloseForciblyTest.java at line 27.

Analyze Your Own Codebase

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

Try Supermodel Free