NettyServer端
结合图理解代码
// 动态获取当前主机ip
String host = InetAddress.getLocalHost().getHostAddress();
int port = 8888;
NioEventLoopGroup boosGroup = new NioEventLoopGroup(1);
NioEventLoopGroup workerGroup = new NioEventLoopGroup(2); // 默认为cpu核数*2 这里手动设置为2
DefaultEventExecutorGroup serviceHandlerGroup = new DefaultEventExecutorGroup(Runtime.getRuntime().availableProcessors() * 2)