首页>代码>SpringBoot+Mybatis+thymeleaf搭建开源个人博客系统>/blog/src/main/java/springboot/client/handler/ClientHandler.java
package springboot.client.handler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelInboundHandlerAdapter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import springboot.modal.vo.UserVo; import springboot.server.codec.HttpJsonRequest; public class ClientHandler extends ChannelInboundHandlerAdapter{ private static final Logger logger = LoggerFactory.getLogger(ClientHandler.class); @Override public void channelActive(ChannelHandlerContext ctx) throws Exception { UserVo userVo = new UserVo(); userVo.setPassword("23456"); logger.info("发送的User为"+userVo.toString()); HttpJsonRequest request = new HttpJsonRequest(null,userVo); ctx.writeAndFlush(request); } @Override public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { logger.info(msg.getClass().getName()); logger.info("接受到的User对象为:"+msg.toString()); } }
最近下载更多
zhouenyi LV6
3月20日
酒酒清欢 LV8
2023年12月5日
微信网友_6724618780348416 LV3
2023年12月4日
yqyqyqyqy LV4
2023年7月23日
3416059514 LV1
2023年6月23日
try8023 LV18
2023年5月4日
ycyycy LV1
2022年10月24日
zxc131313 LV12
2022年10月22日
微信网友_6152246112423936 LV1
2022年9月28日
xingbing LV9
2022年9月5日