一.首先来看一段服务端的示例代码: public class NettyTestServer { public void bind(int port) throws Exception{ EventLoopGroup bossgroup = new NioEventLoopGroup();//创建BOSS线程组 EventLoopGroup workgroup = new NioEventLoopGroup();//创建WORK线程组 try{ ServerBootstrap b = new S…