Home / Class/ QuoteOfTheMomentClientHandler Class — netty Architecture

QuoteOfTheMomentClientHandler Class — netty Architecture

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

Entity Profile

Dependency Diagram

graph TD
  e45251de_325e_51a9_5827_cf9c38b71ca4["QuoteOfTheMomentClientHandler"]
  5014c204_11ec_9b3d_ef05_c52f830a95a5["QuoteOfTheMomentClientHandler.java"]
  e45251de_325e_51a9_5827_cf9c38b71ca4 -->|defined in| 5014c204_11ec_9b3d_ef05_c52f830a95a5
  159311ef_a7b5_2743_b99e_0f7a65a1e327["channelRead0()"]
  e45251de_325e_51a9_5827_cf9c38b71ca4 -->|method| 159311ef_a7b5_2743_b99e_0f7a65a1e327
  dfb4f3c2_084b_81e1_31b6_6610e89ee0a8["exceptionCaught()"]
  e45251de_325e_51a9_5827_cf9c38b71ca4 -->|method| dfb4f3c2_084b_81e1_31b6_6610e89ee0a8

Relationship Graph

Source Code

example/src/main/java/io/netty/example/qotm/QuoteOfTheMomentClientHandler.java lines 23–39

public class QuoteOfTheMomentClientHandler extends SimpleChannelInboundHandler<DatagramPacket> {

    @Override
    public void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
        String response = msg.content().toString(CharsetUtil.UTF_8);
        if (response.startsWith("QOTM: ")) {
            System.out.println("Quote of the Moment: " + response.substring(6));
            ctx.close();
        }
    }

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

Frequently Asked Questions

What is the QuoteOfTheMomentClientHandler class?
QuoteOfTheMomentClientHandler is a class in the netty codebase, defined in example/src/main/java/io/netty/example/qotm/QuoteOfTheMomentClientHandler.java.
Where is QuoteOfTheMomentClientHandler defined?
QuoteOfTheMomentClientHandler is defined in example/src/main/java/io/netty/example/qotm/QuoteOfTheMomentClientHandler.java at line 23.

Analyze Your Own Codebase

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

Try Supermodel Free