只需要在启动之前传入你需要用的channel类型就可以了。

Netty4 ServerBootstrap 初始化channelFactory ReflectiveChannelFactory-LMLPHP

ServerBootstrap初始化channelFactory过程:

Netty4 ServerBootstrap 初始化channelFactory ReflectiveChannelFactory-LMLPHP

Netty4 ServerBootstrap 初始化channelFactory ReflectiveChannelFactory-LMLPHP

Netty4 ServerBootstrap 初始化channelFactory ReflectiveChannelFactory-LMLPHP

Netty4 ServerBootstrap 初始化channelFactory ReflectiveChannelFactory-LMLPHP

最后我们再来看看这个channelFactory的使用场景:

Netty4 ServerBootstrap 初始化channelFactory ReflectiveChannelFactory-LMLPHP

05-11 19:43