package com.inspect.patrol.linkage.handler;

import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.channel.ChannelHandler.Sharable;
import io.netty.channel.socket.DatagramPacket;
import org.springframework.stereotype.Component;

@Component
@Sharable
public class UDPClientHandler extends SimpleChannelInboundHandler<DatagramPacket> {
    protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception {
        System.out.println("channelRead:read msg:" + msg.toString());
        ctx.write("I got server message thanks server!");
    }
}
