随笔分类 - netty学习笔记
摘要:ByteBuf是netty传输数据的容器,是对jdk ByteBuffer的增强 1.ByteBuf的创建 //使用ByteBufAllocator创建空参创建默认的容量为256,也可以自己指定大小,创建时指定 默认是直接内存 ByteBuf buffer = ByteBufAllocator.DE
阅读全文
摘要:服务器端代码 //创建服务器 new ServerBootstrap()//指定eventLoop分组.group(new NioEventLoopGroup()) //指定channel实现 服务器选择NioServerSocketChannel.channel(NioServerSocketCh
阅读全文

浙公网安备 33010602011771号