private BufferChain wrapWithSasl(HBaseSaslRpcServer saslServer, BufferChain bc)
    throws IOException {
    // Looks like no way around this; saslserver wants a byte array. I have to make it one.
    // THIS IS A BIG UGLY COPY.
    byte[] responseBytes = bc.getBytes();
    byte[] token;
    // synchronization may be needed since there can be multiple Handler
    // threads using saslServer or Crypto AES to wrap responses.
    synchronized (saslServer) {
      token = saslServer.wrap(responseBytes, 0, responseBytes.length);
    }
    if (SimpleRpcServer.LOG.isTraceEnabled()) {
      SimpleRpcServer.LOG
        .trace("Adding saslServer wrapped token of size " + token.length + " as call response.");
    }

    ByteBuffer[] responseBufs = new ByteBuffer[2];
    responseBufs[0] = ByteBuffer.wrap(Bytes.toBytes(token.length));
    responseBufs[1] = ByteBuffer.wrap(token);
    return new BufferChain(responseBufs);
  }
If there were some calls that have not been sent out for a long time, we close the connection.
@return the time of the purge.
hbase-server/src/main/java/org/apache/hadoop/hbase/ipc/SimpleRpcServerResponder.java