gtpc2mbc | C/C++ Language Support User's Guide |
This function sets the send_type characteristic. It
overrides the default value set by the cminit or cmaccp
function.
Format
#include <tpfmap.h>
void cmsst(unsigned char *conversation_ID,
signed int *send_type,
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.
- send_type
- This is a pointer to a 4-byte field that, when a program issues a
cmsend function, specifies the information that will be sent to the
remote program in addition to the data supplied to the cmsend
function. This parameter also specifies whether the data will be
buffered or sent immediately. Use one of the following values:
- CM_BUFFER_DATA
- This value specifies that the supplied data cannot be sent until a
sufficient quantity is accumulated.
- CM_SEND_AND_FLUSH
- This value specifies that no additional information is to be sent to the
remote program. The function calls a cmsend followed by a
cmflus.
- CM_SEND_AND_CONFIRM
- This value specifies that the data is to be sent immediately, followed by
a confirmation request.
- CM_SEND_AND_PREP_TO_RECEIVE
- This value specifies that the data is to be sent immediately and the local
transaction program is to be placed in receive state. After
receiving all the data, the remote transaction program enters
send-pending or confirm-send state.
- CM_SEND_AND_DEALLOCATE
- This value specifies that the data is to be sent immediately. Then
the conversation is deallocated.
- return_code
- This is a pointer to a 4-byte field where the return code will be
placed.
Return Codes
The following is a list of return codes that can be returned to the program
that called the cmsst 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 -- This indicates one of the
following:
- The specified conversation_ID is invalid.
- The specified send_type is invalid.
- The sync_level characteristic is CM_NONE, and
send_type is set to CM_SEND_AND_CONFIRM.
Programming Considerations
- You can execute this function on any I-stream.
- The conversation can be in any state.
- The value supplied in conversation_ID must be the conversation ID
returned by the cmaccp or cminit function.
- This function changes the value of the send_type
characteristic.
- This function causes no state change.
- If return_code is not CM_OK, the send_type
characteristic remains unchanged.
- All the values of send_type that indicate dual functions are to
be performed are equivalent to executing the 2 functions sequentially.
For example, the value CM_SEND_AND_FLUSH causes cmsend to
act like a cmsend function followed by a cmflus
function.
Examples
The following example changes the send_type
characteristic.
#include <tpfmap.h>
unsigned char convid[8];
signed int type;
signed int rcode;
.
.
/* set conversation_ID with value returned from accept or initialize */
.
.
cmsst(convid,&type,&rcode);
. /* normal processing path */
.
.
Related Information