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组件)