MQ_TERM_EXIT - Terminate exit environment
Exit providers can supply an MQ_INIT_EXIT function to perform connection-level termination.
Syntax
- MQ_TERM_EXIT (pExitParms, pExitContext, pCompCode, pReason)
Parameters
The MQ_TERM_EXIT call has the following parameters.
pExitParms (PMQAXP) - input/output
Exit parameter structure.
pExitContext (PMQAXC) - input/output
Exit context structure.
pCompCode (PMQLONG) - input/output
Completion code.
pReason (PMQLONG) - input/output
Reason code qualifying pCompCode.
Usage notes
- The MQ_TERM_EXIT function is optional. It is not necessary for an exit suite to register a termination exit if there is no termination processing to be done.
If functions belonging to the exit suite acquire resources during the connection, an MQ_TERM_EXIT function is a convenient point at which to free those resources, for example, freeing storage obtained dynamically.
- If an MQ_TERM_EXIT function is registered when the MQDISC call is issued, the exit function is invoked after all of the MQDISC exit functions have been invoked.
- If MQ_TERM_EXIT returns MQXCC_FAILED in the ExitResponse field of MQAXP, or fails in some other way, the MQDISC call that caused MQ_TERM_EXIT to be invoked also fails, with the CompCode and Reason parameters set to appropriate values.
C invocation
MQ_TERM_EXIT (&ExitParms, &ExitContext, &CompCode, &Reason);The parameters passed to the exit are declared as follows:
PMQAXP pExitParms; /* Exit parameter structure */ PMQAXC pExitContext; /* Exit context structure */ PMQLONG pCompCode; /* Completion code */ PMQLONG pReason; /* Reason code qualifying CompCode */