概述
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的Channel组件所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复