一.先来看一下客户端示例代码. public class NettyClientTest { public void connect(int port, String host) throws Exception { EventLoopGroup group = new NioEventLoopGroup();//与服务端不同,客户端只需要一个IO线程组 try { Bootstrap b = new Bootstrap(); b.group(group) .option(ChannelOpti…