Disconnect - MQ_DISC_EXIT

MQ_DISC_EXIT provides a disconnect exit function to perform before and after MQDISC exit processing. Use function identifier MQXF_DISC with exit reasons MQXR_BEFORE and MQXR_AFTER to register before and after MQDISC call exit functions.

The interface to this function is
MQ_DISC_EXIT (&ExitParms, &ExitContext, &pHconn,
&CompCode, &Reason);
where the parameters are:

    ExitParms (MQAXP) - input/output
    Exit parameter structure.

    ExitContext (MQAXC) - input/output
    Exit context structure.

    pHconn (PMQHCONN) - input
    Pointer to the connection handle. For the before MQDISC call, the value of this field is one of:

    • The connection handle returned on the MQCONN or MQCONNX call
    • Zero, for environments where an environment-specific adapter has connected to the queue manager
    • A value set by a previous exit function invocation

    For the after MQDISC call, the value of this field is zero or a value set by a previous exit function invocation.

    CompCode (MQLONG) - input/output
    Completion code, valid values for which are:

      MQCC_OK
      Successful completion.

      MQCC_WARNING
      Partial completion

      MQCC_FAILED
      Call failed

    Reason (MQLONG) - input/output
    Reason code qualifying the completion code. If the completion code is MQCC_OK, the only valid value is:

      MQRC_NONE
      (0, x'000') No reason to report.

    If the completion code is MQCC_FAILED or MQCC_WARNING, the exit function can set the reason code field to any valid MQRC_* value.


C language invocation

The queue manager logically defines the following variables:
        MQAXP           ExitParms;      /* Exit parameter structure */
        MQAXC           ExitContext;    /* Exit context structure */
        PMQHCONN        pHconn;         /* Ptr to Connection handle */
        MQLONG          CompCode;       /* Completion code */
        MQLONG          Reason;         /* Reason code */
The queue manager then logically calls the exit as follows:
MQ_DISC_EXIT (&ExitParms, &ExitContext, &pHconn,
              &CompCode, &Reason);
Your exit must match the following C function prototype:
void MQENTRY MQ_DISC_EXIT (
PMQAXP          pExitParms,     /* Address of exit parameter structure */
PMQAXC          pExitContext,   /* Address of exit context structure */
PPMQHCONN       ppHconn,        /* Address of ptr to connection handle */
PMQLONG         pCompCode,      /* Address of completion code */
PMQLONG         pReason);       /* Address of reason code qualifying
                                   completion code */
Parent topic: Exit functions