code: public static CompletableFuture<AsyncConnection> createTCP(final Supplier<ByteBuffer> bufferSupplier, Consumer<ByteBuffer> bufferConsumer, final AsynchronousChannelGroup group, final SSLContext sslContext,
          final SocketAddress address, final int readTimeoutSeconds, final int writeTimeoutSeconds) {
          final CompletableFuture<AsyncConnection> future = new CompletableFuture<>();
          try {
              final AsynchronousSocketChannel channel = AsynchronousSocketChannel.open(group);
              try {
                  channel.setOption(StandardSocketOptions.TCP_NODELAY, true);
                  channel.setOption(StandardSocketOptions.SO_KEEPALIVE, true);
                  channel.setOption(StandardSocketOptions.SO_REUSEADDR, true);
              } catch (IOException e) {
              }
              channel.connect(address, null, new CompletionHandler<Void, Void>() {
                  @Override
                  public void completed(Void result, Void attachment) {
                      future.complete(new TcpAioAsyncConnection(bufferSupplier, bufferConsumer, channel, sslContext, address, readTimeoutSeconds, writeTimeoutSeconds, null, null));
                  }
  
                  @Override
                  public void failed(Throwable exc, Void attachment) {
                      future.completeExceptionally(exc);
                  }
              });
          } catch (IOException e) {
              future.completeExceptionally(e);
          }
          return future;
      }
docs: 创建TCP协议客户端连接
  
  @param bufferSupplier      ByteBuffer生产器
  @param bufferConsumer      ByteBuffer回收器
  @param address             连接点子
  @param sslContext          SSLContext
  @param group               连接AsynchronousChannelGroup
  @param readTimeoutSeconds  读取超时秒数
  @param writeTimeoutSeconds 写入超时秒数
  
  @return 连接CompletableFuture