一、类介绍
1.ChannelPool——连接池接口
2.SimpleChannelPool——实现ChannelPool接口,简单的连接池实现
3.FixedChannelPool——继承SimpleChannelPool,有大小限制的连接池实现
4.ChannelPoolMap——管理host与连接池映射的接口
5.AbstractChannelPoolMap——抽象类,实现ChannelPoolMap接口
二、具体使用
a、MyNettyPool——Netty自带连接池的用法
package com.dxfx.netty.demo;
import com.alibaba.fastjson.JSONObject;
import com.dxfx.netty.framework.Constants;
import com.dxfx.netty.framework.DefaultFuture;
import com.dxfx.netty.framework.NettyClientHandler;
import com.dxfx.netty.param.RequestParam;
import com.dxfx.netty.param.Response;
import io.netty.bootstrap.Bootstrap;
import io.netty.channel.Channel;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.pool.AbstractChannelPoolMap;
import io.netty.channel.pool.ChannelPoolHandler;
import io.netty.channel.pool.ChannelPoolMap;
import io.netty.channel.pool.FixedChannelPool;
import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.codec.DelimiterBasedFrameDecoder;
import io.netty.handler.codec.Delimiters;
import io.netty.handler.codec.string.StringDecoder;
import io.netty.handler.codec.string.StringEncoder;
import