public class ProtoBufServerHandler extends ChannelInboundHandlerAdapter {@Overridepublic void channelRead(ChannelHandlerContext ctx, Object msg)throws Exception {PersonProto.Person req = (PersonProto.Person)msg;System.out.println("get data name = "+req.getName());}@Overridepublic void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) {if(cause instanceof IOException){System.out.println("远程客户端强迫关闭了一个现有的连接。");}ctx.close();}}
