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内容请搜索靠谱客的其他文章。
发表评论 取消回复