aeron-client/src/main/java/io/aeron/CommonContext.java
public static boolean requestDriverTermination(
        final File directory,
        final DirectBuffer tokenBuffer,
        final int tokenOffset,
        final int tokenLength)
    {
        final File cncFile = new File(directory, CncFileDescriptor.CNC_FILE);

        if (cncFile.exists() && cncFile.length() > 0)
        {
            final MappedByteBuffer cncByteBuffer = IoUtil.mapExistingFile(cncFile, "CnC file");
            try
            {
                final UnsafeBuffer cncMetaDataBuffer = CncFileDescriptor.createMetaDataBuffer(cncByteBuffer);
                final int cncVersion = cncMetaDataBuffer.getIntVolatile(cncVersionOffset(0));

                if (CncFileDescriptor.CNC_VERSION != cncVersion)
                {
                    throw new AeronException(
                        "Aeron CnC version does not match: required=" + CNC_VERSION + " version=" + cncVersion);
                }

                final ManyToOneRingBuffer toDriverBuffer = new ManyToOneRingBuffer(
                    CncFileDescriptor.createToDriverBuffer(cncByteBuffer, cncMetaDataBuffer));
                final long clientId = toDriverBuffer.nextCorrelationId();

                final DriverProxy driverProxy = new DriverProxy(toDriverBuffer, clientId);

                return driverProxy.terminateDriver(tokenBuffer, tokenOffset, tokenLength);
            }
            finally
            {
                IoUtil.unmap(cncByteBuffer);
            }
        }

        return false;
    }
public static boolean requestDriverTermination(
        final File directory,
        final DirectBuffer tokenBuffer,
        final int tokenOffset,
        final int tokenLength)
    {
        final File cncFile = new File(directory, CncFileDescriptor.CNC_FILE);

        if (cncFile.exists() && cncFile.length() > 0)
        {
            final MappedByteBuffer cncByteBuffer = IoUtil.mapExistingFile(cncFile, "CnC file");
            try
            {
                final UnsafeBuffer cncMetaDataBuffer = CncFileDescriptor.createMetaDataBuffer(cncByteBuffer);
                final int cncVersion = cncMetaDataBuffer.getIntVolatile(cncVersionOffset(0));

                if (CncFileDescriptor.CNC_VERSION != cncVersion)
                {
                    throw new AeronException(
                        "Aeron CnC version does not match: required=" + CNC_VERSION + " version=" + cncVersion);
                }

                final ManyToOneRingBuffer toDriverBuffer = new ManyToOneRingBuffer(
                    CncFileDescriptor.createToDriverBuffer(cncByteBuffer, cncMetaDataBuffer));
                final long clientId = toDriverBuffer.nextCorrelationId();

                final DriverProxy driverProxy = new DriverProxy(toDriverBuffer, clientId);

                return driverProxy.terminateDriver(tokenBuffer, tokenOffset, tokenLength);
            }
            finally
            {
                IoUtil.unmap(cncByteBuffer);
            }
        }

        return false;
    }
Request a driver to run its termination hook.

@param directory for the driver.
@param tokenBuffer containing the optional token for the request.
@param tokenOffset within the tokenBuffer at which the token begins.
@param tokenLength of the token in the tokenBuffer.
@return true if request was sent or false if request could not be sent.