![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
netty
文章平均质量分 81
gavin-zlx
这个作者很懒,什么都没留下…
展开
-
Netty学习-handler 的基类选择!
netty 作为 rpc框架,其nio的特性很好,目前再看《Netty权威指南》书籍,下载了书中的例子照做,发现有些程序运行不了,通过解决分析,记录如下。是netty 的入门例子,我使用的版本是,dependency> groupId>io.nettygroupId> artifactId>netty-allartifactId> versi原创 2017-05-13 15:25:48 · 1587 阅读 · 0 评论 -
Netty protobuf使用,自定义Encoder 和DeCoder
Server 监听客户发送的信息,并且打印Client 发送5s 发送信息。1.编辑google 的proto文件Msg.protosyntax = "proto3";message Person { // ID(必需) int32 id = 1; // 姓名(必需) string na原创 2017-05-15 20:58:51 · 3506 阅读 · 0 评论 -
Netty protobuf解析2-官方方法解析
关键代码如下 p.addLast(new ProtobufVarint32FrameDecoder());// 解码1. 根据byte 的头长度 来 分割 p.addLast(new ProtobufDecoder( Msg.Person.getDefaultInstance())); //解码2。 byte 转化为 实体类原创 2017-05-16 13:55:21 · 829 阅读 · 0 评论 -
Netty 学习方法及记录
ChannelPipeline源码ChannelPipeline的开头描述部分对于netty 很有帮助,他解释了 channelHandler,addLast方法,事件传播,以及io线程和业务线程分离等等,推荐各位认真看看。 不管我们上传发送什么数据格式给底层(也就netty层)都要转化为ByteBuf进行传输,也就是最进行io的一定是二进制,其他String或者POJO都原创 2017-05-16 19:21:37 · 350 阅读 · 0 评论