gtpc2mbe | C/C++ Language Support User's Guide |
This function determines if a REQUEST_TO_SEND notification was received
from the remote program for the specified conversation.
Format
#include <tpfmap.h>
void cmtrts(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 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.
If return_code is not CM_OK, request_to_send_received
does not contain a meaningful value.
- 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 cmtrts 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 program is not in send,
send-pending, or receive state.
Programming Considerations
- You can execute this function on any I-stream.
- The conversation must be in one of the following states:
receive
send
send-pending
- The value supplied in conversation_ID must be the conversation ID
returned by the cmaccp or cminit function.
- There are no characteristics that affect this function.
- This function does not cause a state change.
- When the local LU receives a REQUEST_TO_SEND notification, it holds the
notification until the local program does a function with the
request_to_send_received parameter (such as this one). Only
one notification is held at one time. Additional notifications are
discarded until the held notification is sent to the local program.
- The local LU discards the notification after it is given to the local
program.
- To enter receive state, the local transaction program must call
the appropriate function, such as cmrcv or cmptr, when
the REQUEST_TO_SEND indication is received.
Examples
The following example checks to see if a REQUEST_TO_SEND notification was
received.
#include <tpfmap.h>
unsigned char *buff;
signed int rtsr;
signed int rcode;
.
.
/* set conversation_ID with value returned from accept or initialize */
.
.
cmtrts(convid,&rtsr,&rcode);
. /* normal processing path */
.
.
Related Information