java nio模型理解
1、tcp信道,具体参数详情参考api ServerSocketChannel:创建、接收、关闭、读写、阻塞 SocketChannel:创建、连接、关闭、读写、阻塞(测试连接性) 2、Selector:创建、关闭选择器 案例一: NIOAccepter服务端线程 package com.warehouse.data.nio; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; import java.nio.channels.ServerSocketChannel; import java.nio.channels.SocketChannel; import java.util.Set; import javax.imageio.IIOException; /** * ${DESCRIPTION} * package com.warehouse.data.nio * * @author zli [liz@yyft.com] * @version v1.0 * @create 2017-03-28 9:55 **/ public class NIOAcceptor