Home / Class/ HAProxyClient Class — netty Architecture

HAProxyClient Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  584cf7f3_f52d_d2f3_ff7e_4fc4c81a81b1["HAProxyClient"]
  5873a087_5de9_1f50_1462_dc641a334195["HAProxyClient.java"]
  584cf7f3_f52d_d2f3_ff7e_4fc4c81a81b1 -->|defined in| 5873a087_5de9_1f50_1462_dc641a334195
  7bc8e18a_6d09_2c08_3c11_207591407424["main()"]
  584cf7f3_f52d_d2f3_ff7e_4fc4c81a81b1 -->|method| 7bc8e18a_6d09_2c08_3c11_207591407424

Relationship Graph

Source Code

example/src/main/java/io/netty/example/haproxy/HAProxyClient.java lines 34–61

public final class HAProxyClient {

    private static final String HOST = System.getProperty("host", "127.0.0.1");

    public static void main(String[] args) throws Exception {
        EventLoopGroup group = new MultiThreadIoEventLoopGroup(NioIoHandler.newFactory());
        try {
            Bootstrap b = new Bootstrap();
            b.group(group)
             .channel(NioSocketChannel.class)
             .handler(new HAProxyHandler());

            // Start the connection attempt.
            Channel ch = b.connect(HOST, PORT).sync().channel();

            HAProxyMessage message = new HAProxyMessage(
                    HAProxyProtocolVersion.V2, HAProxyCommand.PROXY, HAProxyProxiedProtocol.TCP4,
                    "127.0.0.1", "127.0.0.2", 8000, 9000);

            ch.writeAndFlush(message).sync();
            ch.writeAndFlush(Unpooled.copiedBuffer("Hello World!", CharsetUtil.US_ASCII)).sync();
            ch.writeAndFlush(Unpooled.copiedBuffer("Bye now!", CharsetUtil.US_ASCII)).sync();
            ch.close().sync();
        } finally {
            group.shutdownGracefully();
        }
    }
}

Frequently Asked Questions

What is the HAProxyClient class?
HAProxyClient is a class in the netty codebase, defined in example/src/main/java/io/netty/example/haproxy/HAProxyClient.java.
Where is HAProxyClient defined?
HAProxyClient is defined in example/src/main/java/io/netty/example/haproxy/HAProxyClient.java at line 34.

Analyze Your Own Codebase

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

Try Supermodel Free