性能上从低到高如下:

  • OioSocketChannel:传统,阻塞式编程。
  • NioSocketChannel:select/poll或者epoll,jdk 7之后linux下会自动选择epoll。epoll原理及与select/poll的伸缩性性能测试基准
  • EpollSocketChannel:epoll,仅限linux,提供更多额外选项。
  • EpollDomainSocketChannel:ipc模式,仅限客户端、服务端在相同主机的情况,从4.0.26版本开始支持,见https://github.com/netty/netty/pull/3344。

 

关于unix domain socket的详细解释,可参考:

http://blog.csdn.net/guxch/article/details/7041052

关于epoll/poll/select的白话文解释,可参考:

https://my.oschina.net/dclink/blog/287198

epoll用法以及帮助手册:

http://man7.org/linux/man-pages/man7/epoll.7.html

http://blog.chinaunix.net/uid-311680-id-2439723.html

http://www.tuicool.com/articles/y6je2yf

http://www.tuicool.com/articles/mQ3iAr

关于epoll模式下连接的超时时间设置可参考:

 http://stackoverflow.com/questions/6590531/how-do-i-implement-epoll-timeout 

相关文章:

  • 2021-10-09
  • 2021-05-01
  • 2021-11-19
  • 2022-02-18
  • 2021-10-12
  • 2021-07-19
  • 2021-10-31
猜你喜欢
  • 2021-09-11
  • 2021-06-14
  • 2021-04-21
  • 2022-02-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案