摘要: @Slf4j public class NettyClientTest { public static void main(String[] args) throws Exception { EventLoopGroup workerEventLoopGroup = new NioEventLoop 阅读全文
posted @ 2024-05-27 22:20 陈鸿圳 阅读(134) 评论(0) 推荐(0)
摘要: # 假设pipeline里面有这样的handler顺序 OutBoundHandler1 InBoundHandler1 OutBoundHandler2 InBoundHandler2 当在【InBoundHandler1】里面执行【ctx.write()】时 向上执行触发【OutBoundHan 阅读全文
posted @ 2024-05-27 22:18 陈鸿圳 阅读(119) 评论(0) 推荐(0)
摘要: 服务端和客户端的共用代码 【ConnectionInfo.java】 @Getter @Setter public class ConnectionInfo { private StringBuffer readBuffer = new StringBuffer(); private AtomicI 阅读全文
posted @ 2024-05-27 22:17 陈鸿圳 阅读(14) 评论(0) 推荐(0)
摘要: pipeline // out handler socketChannel.pipeline().addLast(new StringEncoder()); // in handler socketChannel.pipeline().addLast(new StringDecoder()); so 阅读全文
posted @ 2024-05-27 22:16 陈鸿圳 阅读(35) 评论(0) 推荐(0)
摘要: pipeline,注意out handler要在in handler之前 // out handler socketChannel.pipeline().addLast(new StringEncoder()); socketChannel.pipeline().addLast(new MyServ 阅读全文
posted @ 2024-05-27 22:15 陈鸿圳 阅读(30) 评论(0) 推荐(0)
摘要: 添加依赖 <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.110.Final</version> </dependency> <dependency> <groupId> 阅读全文
posted @ 2024-05-27 22:14 陈鸿圳 阅读(38) 评论(0) 推荐(0)
点击右上角即可分享
微信分享提示