code: protected List<MemcachedNode> createConnections(
      final Collection<InetSocketAddress> addrs) throws IOException {
      List<MemcachedNode> connections = new ArrayList<MemcachedNode>(addrs.size());
  
      for (SocketAddress sa : addrs) {
        SocketChannel ch = SocketChannel.open();
        ch.configureBlocking(false);
        MemcachedNode qa = connectionFactory.createMemcachedNode(sa, ch, bufSize);
        qa.setConnection(this);
        int ops = 0;
        Socket socket = ch.socket();
        socket.setTcpNoDelay(!connectionFactory.useNagleAlgorithm());
        socket.setKeepAlive(connectionFactory.getKeepAlive());
        
        try {
          if (ch.connect(sa)) {
            getLogger().info("Connected to %s immediately", qa);
            connected(qa);
          } else {
            getLogger().info("Added %s to connect queue", qa);
            ops = SelectionKey.OP_CONNECT;
          }
  
          selector.wakeup();
          qa.setSk(ch.register(selector, ops, qa));
          assert ch.isConnected()
              || qa.getSk().interestOps() == SelectionKey.OP_CONNECT
              : "Not connected, and not wanting to connect";
        } catch (SocketException e) {
          getLogger().warn("Socket error on initial connect", e);
          queueReconnect(qa);
        }
        connections.add(qa);
      }
  
      return connections;
    }
docs: Create connections for the given list of addresses.
  
  @param addrs the list of addresses to connect to.
  @return addrs list of {@link MemcachedNode}s.
  @throws IOException if connecting was not successful.