gtpc2mas | C/C++ Language Support User's Guide |
This function sends a confirmation reply to the remote transaction
program. This allows the 2 programs to synchronize their
processing. The local TPF transaction program can call this function
when it receives a confirmation request from the remote transaction
program.
Format
#include <tpfmap.h>
void cmfmd(unsigned char *conversation_ID,
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.
- 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 cmcfmd function. A complete list of the
return codes and their definitions can be found in Table 45.
- CM_OK
- CM_PRODUCT_SPECIFIC_ERROR
- CM_PROGRAM_PARAMETER_CHECK -- The specified conversation_ID
is invalid.
- CM_PROGRAM_STATE_CHECK -- The conversation is not in
confirm, confirm-send, or confirm-deallocate
state.
Programming Considerations
- You can execute this function on any I-stream.
- The conversation must be in one of the following states:
confirm
confirm-send
confirm-deallocate.
- The value supplied in conversation_ID must be the conversation ID
returned by the cmaccp or cminit function.
- There are no characteristics that modify this function.
- When the return_code is CM_OK:
- If the conversation was in confirm state, it changes to
receive state.
- If the conversation was in confirm-send state, it changes to
send state.
- If the conversation was in confirm-deallocate status, it
terminates. The conversation is deallocated and no longer
exists.
- A transaction program can call this function only as a reply to a
confirmation request; the function cannot be called at any other
time. Transaction programs can use this function for various
application-level functions. For example, the remote program can send
data followed by a confirmation request. When the local program
receives the confirmation request, it can call this function as an indication
that it received and processed the data without error.
Examples
The following example sends a confirmation reply to the remote transaction
program.
#include <tpfmap.h>
unsigned char convid[8];
signed int rcode;
.
.
/* set conversation_ID with value returned from accept or initialize */
.
.
cmcfmd(convid,&rcode);
. /* normal processing path */
.
.
Related Information