一.netty服务端的启动1.启动服务端Bootstrap,绑定group事件循环组,绑定channel为NioServerSocketChannel,绑定服务端handler,绑定客户端childHandler(1.1),绑定tcp的Option参数,还有attrs一般不会用2.init和regi...
使用自定义的NioSocketChannelpublic class MyNioSocketChannel extends NioSocketChannel { @Override protected ChannelId newId() { return new Chann...
https://blog.csdn.net/weixin_41385912/article/details/110944462...
添加:AttributeKey<String> key = AttributeKey.valueOf("sn");ctx.channel().attr(key).set(deviceSn);获取:AttributeKey<String> key = Att...