gtpc2mb5C/C++ Language Support User's Guide

cmsend-Send Data to Remote Transaction Program

This function sends data to the remote transaction program.

Format

#include   <tpfmap.h>
void       cmsend(unsigned char *conversation_ID,
                  unsigned char *buffer,
                  signed int *send_length,
                  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.

buffer
This is a pointer to a location in memory that contains the data to be sent. The length of the data is specified by the send_length parameter.

send_length
This is a pointer to a 4-byte field that contains the number of bytes of data that are to be sent. This value can be from 0-32 767. If this parameter is 0, a null data record is sent.

request_to_send_received
This is a pointer to a 4-byte field where a REQUEST_TO_SEND notification is placed. Possible values are:

CM_REQ_TO_SEND_RECEIVED
This value indicates that the local program received a REQUEST_TO_SEND notification from the remote program. This is a request that the local program enter receive state, which allows the remote program to 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 will be placed.

Return Codes

The following is a list of return codes that can be returned to the program that called the cmsend function. A complete list of the return codes and their definitions can be found in Table 45.

Programming Considerations

Examples

The following example sends data to the remote transaction program.

#include <tpfmap.h>
 
      unsigned char convid[8];
      unsigned char *buff;
      signed int    len;
      signed int    rtsr;
      signed int    rcode;
      .
      .
/* set conversation_ID with value returned from accept or initialize */
      .
      .
cmsend(convid,buff,&len,&rtsr,&rcode);
      .                       /*  normal processing path             */
      .
      .

Related Information