![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
netty4
yaodaojun
这个作者很懒,什么都没留下…
展开
-
Netty4(一)NioEventLoopGroup
先看默认构造方法public NioEventLoopGroup() {this(0);}有参构造方法public NioEventLoopGroup(int nThreads) {this(nThreads, (Executor)null);}public NioEventLoopGroup(int nThreads, Executor executor) {//获得了Selector提供器th...原创 2018-03-03 22:19:15 · 271 阅读 · 0 评论 -
netty4(二)ServerBootstrap的启动一
EventLoopGroup bossGroup = new NioEventLoopGroup(); // (1) //负责数据读写 EventLoopGroup workerGroup = new NioEventLoopGroup(); //服务类 try { ServerBootstrap bootstrap = new ServerBootstrap(); //react...原创 2018-03-03 23:00:19 · 1126 阅读 · 0 评论 -
netty4(三)NioEventLoop
在NioEventLoopGroup里的线程是NioEventLoop就是在这里处理连接的,如果是在服务端的话处理完key之后会去ServerBootstrapAcceptor的channelReadprotected void run() { for (;;) { try { switch (selectStrategy.calculateStra...原创 2018-03-03 23:26:52 · 156 阅读 · 0 评论