Home / Class/ DiscardClient Class — netty Architecture

DiscardClient Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  91b8af10_120c_ade8_b41a_480990d8a12d["DiscardClient"]
  94c3f9ef_be24_2130_d20f_d5d46488c242["DiscardClient.java"]
  91b8af10_120c_ade8_b41a_480990d8a12d -->|defined in| 94c3f9ef_be24_2130_d20f_d5d46488c242
  1d9d3c3a_2968_a99a_23bd_cbd00ea35915["main()"]
  91b8af10_120c_ade8_b41a_480990d8a12d -->|method| 1d9d3c3a_2968_a99a_23bd_cbd00ea35915

Relationship Graph

Source Code

example/src/main/java/io/netty/example/discard/DiscardClient.java lines 33–68

public final class DiscardClient {

    static final String HOST = System.getProperty("host", "127.0.0.1");
    static final int PORT = Integer.parseInt(System.getProperty("port", "8009"));
    static final int SIZE = Integer.parseInt(System.getProperty("size", "256"));

    public static void main(String[] args) throws Exception {
        // Configure SSL.
        final SslContext sslCtx = ServerUtil.buildSslContext();

        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            Bootstrap b = new Bootstrap();
            b.group(group)
             .channel(NioSocketChannel.class)
             .handler(new ChannelInitializer<SocketChannel>() {
                 @Override
                 protected void initChannel(SocketChannel ch) throws Exception {
                     ChannelPipeline p = ch.pipeline();
                     if (sslCtx != null) {
                         p.addLast(sslCtx.newHandler(ch.alloc(), HOST, PORT));
                     }
                     p.addLast(new DiscardClientHandler());
                 }
             });

            // Make the connection attempt.
            ChannelFuture f = b.connect(HOST, PORT).sync();

            // Wait until the connection is closed.
            f.channel().closeFuture().sync();
        } finally {
            group.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the DiscardClient class?
DiscardClient is a class in the netty codebase, defined in example/src/main/java/io/netty/example/discard/DiscardClient.java.
Where is DiscardClient defined?
DiscardClient is defined in example/src/main/java/io/netty/example/discard/DiscardClient.java at line 33.

Analyze Your Own Codebase

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

Try Supermodel Free