1、建立 NIO 连接
http://communitygrids.blogspot.com/2007/09/windows-vista-sockets-java-nio-and.html
http://communitygrids.blogspot.com/2007/09/windows-vista-sockets-java-nio-and.html
SocketChannel sc = SocketChannel.open();
sc.socket().setReuseAddress(true);
sc.socket().setKeepAlive(true);
sc.configureBlocking(false);
InetSocketAddress ia = new InetSocketAddress(_hostName, _portNum);
sc.connect(ia);