gtpc2mar | C/C++ Language Support User's Guide |
This function sends a confirmation request to the remote transaction
program and waits for the confirmation reply. This allows the 2
programs to synchronize their processing.
Format
#include <tpfmap.h>
void cmcfm(unsigned char *conversation_ID,
signed int *request_to_send_received,
signed int *return_code);
- conversation_ID
- This is a pointer to an 8-byte character array that contains the
conversation ID. This conversation ID must be the ID returned by the
cminit (INITIALIZE) or cmaccp (ACCEPT_CONVERSATION) that
started this conversation.
- request_to_send_received
- This is a pointer to a 4-byte field where the REQUEST_TO_SEND_RECEIVED
indication is placed. The REQUEST_TO_SEND_RECEIVED indication is one of
the following:
- CM_REQ_TO_SEND_RECEIVED
- This value indicates that a REQUEST_TO_SEND indication was received from
the remote transaction program. This is a request that the local TPF
transaction program enter receive state, so the remote program can
enter send state.
- CM_REQ_TO_SEND_NOT_RECEIVED
- This value indicates that a REQUEST_TO_SEND notification was not
received.
- return_code
- This is a pointer to a 4-byte field where the return code is to be
placed.
Return Codes
The following is a list of return codes that can be returned to the program
that called the cmcfm function. A complete list of the
return codes and their definitions can be found in Table 45.
- CM_OK -- The remote program responded with a cmcfmd
(CONFIRMED).
- CM_CONVERSATION_TYPE_MISMATCH
- CM_DEALLOCATED_ABEND
- CM_PRODUCT_SPECIFIC_ERROR
- CM_PROGRAM_ERROR_PURGING
- CM_PROGRAM_PARAMETER_CHECK -- The sync_level is
CM_NONE, or the specified conversation_ID is invalid.
- CM_PROGRAM_STATE_CHECK -- The conversation is not in send
or send-pending state.
- CM_RESOURCE_FAILURE_NO_RETRY
- CM_RESOURCE_FAILURE_RETRY
- CM_SVC_ERROR_PURGING
- CM_SYNC_LVL_NOT_SUPPORTED_PGM
- CM_TP_NOT_AVAILABLE_NO_RETRY
- CM_TP_NOT_AVAILABLE_RETRY
- CM_TPN_NOT_RECOGNIZED
Programming Considerations
- You can execute this function on any I-stream.
- The conversation must be in send or send-pending
state.
- The value supplied in conversation_ID must be the conversation ID
returned by the cmaccp or cminit function.
- The sync_level characteristic must be
CM_CONFIRM.
- If this function is called while the conversation is in
send-pending state and return_code is CM_OK, the
conversation enters send state.
- If the return_code is CM_PROGRAM_ERROR_PURGING or
CM_SVC_ERROR_PURGING, the conversation enters receive state.
- This call causes the local program's send buffer to be
flushed.
- This function uses TPF's EVENT and POST facility to suspend the ECB
until the program receives a confirmation reply. Because the ECB is
suspended, release all unnecessary resources before issuing this
function. Failure to do so can cause serious system performance.
- If the program does not receive a confirmation reply in a certain amount
of time, TPF/APPC support issues a DEALLOCATE request to terminate the
conversation. The amount of time that the system waits is determined by
the value you specify for the TPRECV parameter on the SNAKEY macro. See
TPF ACF/SNA Network Generation for information about
the SNAKEY macro.
- When the request_to_send_received parameter is
CM_REQ_TO_SEND_RECEIVED, the remote program is requesting the local
TPF transaction program to enter receive state and thereby place
the remote program in send or send-pending state.
The local TPF transaction program enters receive state by issuing
cmrcv or cmptr. The remote partner program enters
the corresponding send or send-pending state when it
calls cmrcv and receives the SEND indication on the
status_received parameter.
Examples
The following example sends a confirmation request to the remote
transaction program and waits for the confirmation reply.
#include <tpfmap.h>
unsigned char convid[8];
signed int rtsr;
signed int rcode;
.
.
/* set conversation_ID with value returned from accept or initialize */
.
.
cmcfm(convid,&rtsr,&rcode);
. /* normal processing path */
.
.
Related Information