boolean belongsToCluster(final MemcachedNode node) {
    for (MemcachedNode n : locator.getAll()) {
      if (n.getSocketAddress().equals(node.getSocketAddress())) {
        return true;
      }
    }
    return false;
  }
Makes sure that the given node belongs to the current cluster.

Before trying to connect to a node, make sure it actually belongs to the
currently connected cluster.
src/main/java/net/spy/memcached/MemcachedConnection.java