netty服务端怎么打印与其连接的客户端的id?netty服务端怎么打印与其连接的客户端的id?netty服务端怎么打印与其连接的客户端的id?
1条回答 默认 最新
- 明教第三十四代觉主 2019-04-17 14:39关注
server端的channelRead0(ChannelHandlerContext ctx, String msg)方法,取ctx.channel(),得到当前连接的channel,channel.id()
得到的就是当前channel的id解决 无用评论 打赏 举报