我是靠谱客的博主 呆萌黄蜂,这篇文章主要介绍NIO与Netty的Channel组件,现在分享给大家,希望可以做个参考。

Java NIO中提供针对TCP/IP的Channel封装如下:

SelectableChannel
A channel that can be multiplexed via a {@link Selector}.
即支持多路分发复用的抽象通道,即可以通过一个Selector管理多个可选择的通道。

ServerSocketChannel
A selectable channel for stream-oriented listening sockets.


SocketChannel
A selectable channel for stream-oriented connecting sockets.


DatagramChannel
A selectable channel for datagram-oriented sockets. 


Netty 中讲NIO提供的原始Channel进行一层封装,因此Netty中的Channel不同于NIO的原始Channel。
ServerSocketChannel
A TCP/IP ServerChannel which accepts incoming TCP/IP connections.


SocketChannel
A TCP/IP socket Channel which was either accepted by ServerSocketChannel or created by ClientSocketChannelFactory.


DatagramChannel
A UDP/IP Channel which is created by DatagramChannelFactory.

最后

以上就是呆萌黄蜂最近收集整理的关于NIO与Netty的Channel组件的全部内容,更多相关NIO与Netty内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(55)

评论列表共有 0 条评论

立即
投稿
返回
顶部