![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
NIO源码系列
王伟王胖胖
这个作者很懒,什么都没留下…
展开
-
NIO源码系列之Selector史上最详细分析三
NIO源码系列之Selector史上最详细分析三选择器注册serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);findKey(Selector sel)register(AbstractSelectableChannel ch, int ops, Object attachment)interestOps(int ops)s...原创 2020-02-03 21:24:44 · 786 阅读 · 0 评论 -
NIO源码系列之Selector史上最详细分析二
NIO源码系列之Selector史上最详细分析二windows下的非阻塞设置windows下的selectpollAddressLiuux下的Epoll总结windows下的非阻塞设置在NIO里面,我们设置一般都会用非阻塞,也就是这样设置erverSocketChannel.configureBlocking(false);.,具体他做了什么呢,我们一起来看看,最终可以跟到一个JNI的本地方法...原创 2020-02-03 21:24:05 · 900 阅读 · 0 评论 -
NIO源码系列之Selector史上最详细分析一
NIO源码系列之Selector史上最详细分析Linux里的select函数Linux里的select函数在讲NIO里的Selector之前,我觉得有必要先有预先的知识铺垫,否则很难理解NIO的Selector在做什么。所以打算先讲下Linux的select,我们可以在Linux中用命令man select查看这个函数,我截取了一些:/* According to POSIX.1-2001...原创 2020-02-03 21:23:20 · 1309 阅读 · 1 评论 -
NIO源码系列之Channel
NIO与Netty源码系列之ChannelChannel通道NetworkChannelSelectableChannelServerSocketChannel服务器简单例子ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();Selector selector = Selector.open();serverSo...原创 2020-01-21 22:13:39 · 555 阅读 · 0 评论 -
NIO源码系列之Buffer
NIO与Netty源码系列一Buffer基本属性基本方法positionlimitmarkresetclearflipremaininghasRemaining子类IntBufferallocateputgetwrap(int[] array)wrap(int[] array, int offset, int length)get(int i)get(int[] dst, int offset, ...原创 2020-01-21 22:13:01 · 478 阅读 · 1 评论