
02_Netty
青年道士
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
02_netty粘包/拆包的解决:字符串的编码解码
netty中的粘包、拆包解决方案 LineBasedFrameDecode+StringDecoder LineBasedFrameDecode:遍历字节数组,遇到"\n","\r\n"以此作为结束符。可以配置单行的最大长度,超过后抛出异常。 StringDecoder:将接收到的字节转换成字符串。 initChannel(SocketChannel ch) throws Exceptio原创 2015-11-30 12:06:58 · 2755 阅读 · 0 评论 -
01_netty5入门应用-时间服务器程序代码
public interface Constants { public String QUERY_TIME_ORDER = "1"; public String EN_CODE_UTF8 = "UTF-8"; public int DEFAULT_PORT = 8080; } package cn.iktz.netty.test.time.client; import io.netty.原创 2015-11-30 01:02:37 · 342 阅读 · 0 评论 -
netty 客户端线程退出
再完成请求的方法里,加入 channel.close()方法原创 2015-12-01 02:19:31 · 1209 阅读 · 0 评论