引导

一. Bootstrap

1. 用于客户端或者使用了无连接协议的应用程序中,负责为程序创建Channel;

2. Bootstrap类将会在bind() 后创建一个新的Channel,然后调用connect() 建立连接,connect() 被调用后Bootstrap类会创建一个新的Channel;

二. ServerBootstrap

1. 当bind() 被调用时将会创建一个ServerChannel,ServerChannel负责创建子Channel,每个子Channel代表一个已被接受的连接;

三. ChannelInboundHandlerAdapter

1. initChannel 提供了一种将多个ChannelHandler添加到一个ChannelPipeline中的简便方法;

四. ChannelOption

1. option() 将ChannelOption应用到引导,提供的值会被自动应用到所创建的所有Channel;

五. 关闭

1. EventLoopGroup 处理挂起的事件和事务,关闭后释放所有活动的线程;

扫描二维码关注公众号,回复: 9977891 查看本文章

2. shutdownGracefully() 异步操作,返回一个Future,这个Future将在关闭完成时接收到通知;

猜你喜欢

转载自www.cnblogs.com/bbbbs/p/12528974.html
今日推荐