Home / Class/ ByteEchoClientHandler Class — netty Architecture

ByteEchoClientHandler Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  4270bee1_70de_a32c_77e3_714535189981["ByteEchoClientHandler"]
  ba9453d2_4806_e5b0_3fb9_8c52b1b4cc90["ByteEchoClientHandler.java"]
  4270bee1_70de_a32c_77e3_714535189981 -->|defined in| ba9453d2_4806_e5b0_3fb9_8c52b1b4cc90
  479b623e_1369_4534_2469_ec664d8fcbe0["ByteEchoClientHandler()"]
  4270bee1_70de_a32c_77e3_714535189981 -->|method| 479b623e_1369_4534_2469_ec664d8fcbe0
  b51cf52a_e250_efd7_5a57_831f7a219cc6["channelActive()"]
  4270bee1_70de_a32c_77e3_714535189981 -->|method| b51cf52a_e250_efd7_5a57_831f7a219cc6
  fc7973d2_ca05_0c2c_ef1e_904a36a4acca["channelRead0()"]
  4270bee1_70de_a32c_77e3_714535189981 -->|method| fc7973d2_ca05_0c2c_ef1e_904a36a4acca
  def622d1_9831_ff14_6656_345826705112["channelReadComplete()"]
  4270bee1_70de_a32c_77e3_714535189981 -->|method| def622d1_9831_ff14_6656_345826705112
  b5c05d59_3f75_9052_d895_c4e16c45b0ee["exceptionCaught()"]
  4270bee1_70de_a32c_77e3_714535189981 -->|method| b5c05d59_3f75_9052_d895_c4e16c45b0ee

Relationship Graph

Source Code

example/src/main/java/io/netty/example/udt/echo/bytes/ByteEchoClientHandler.java lines 29–64

public class ByteEchoClientHandler extends SimpleChannelInboundHandler<ByteBuf> {

    private final ByteBuf message;

    public ByteEchoClientHandler() {
        super(false);

        message = Unpooled.buffer(ByteEchoClient.SIZE);
        for (int i = 0; i < message.capacity(); i++) {
            message.writeByte((byte) i);
        }
    }

    @Override
    public void channelActive(final ChannelHandlerContext ctx) {
        System.err.println("ECHO active " + NioUdtProvider.socketUDT(ctx.channel()).toStringOptions());
        ctx.writeAndFlush(message);
    }

    @Override
    public void channelRead0(ChannelHandlerContext ctx, ByteBuf msg) {
        ctx.write(msg);
    }

    @Override
    public void channelReadComplete(ChannelHandlerContext ctx) {
        ctx.flush();
    }

    @Override
    public void exceptionCaught(final ChannelHandlerContext ctx, final Throwable cause) {
        cause.printStackTrace();
        ctx.close();
    }

}

Frequently Asked Questions

What is the ByteEchoClientHandler class?
ByteEchoClientHandler is a class in the netty codebase, defined in example/src/main/java/io/netty/example/udt/echo/bytes/ByteEchoClientHandler.java.
Where is ByteEchoClientHandler defined?
ByteEchoClientHandler is defined in example/src/main/java/io/netty/example/udt/echo/bytes/ByteEchoClientHandler.java at line 29.

Analyze Your Own Codebase

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

Try Supermodel Free