code: public void shutdown() throws IOException {
      shutDown = true;
      try {
        Selector s = selector.wakeup();
        assert s == selector : "Wakeup returned the wrong selector.";
        for (MemcachedNode node : locator.getAll()) {
          if (node.getChannel() != null) {
            node.getChannel().close();
            node.setSk(null);
            if (node.getBytesRemainingToWrite() > 0) {
              getLogger().warn("Shut down with %d bytes remaining to write",
                node.getBytesRemainingToWrite());
            }
            getLogger().debug("Shut down channel %s", node.getChannel());
          }
        }
  
        selector.close();
        getLogger().debug("Shut down selector %s", selector);
      } finally {
        running = false;
      }
    }
docs: Shut down all connections and do not accept further incoming ops.