gtpc2mal | C/C++ Language Support User's Guide |
This function waits for posting to occur on any mapped or basic
conversation from a list of conversations. Posting of a conversation
occurs when posting is active for the conversation and information that the
conversation can receive, such as data, conversation status, or a request for
confirmation, is available.
Format
#include <tppc.h>
void tppc_wait(unsigned int *residl,
struct tppc_return_codes *rcode,
unsigned int *respstd);
- residl
- This is a pointer to a variable-length field that contains the resource
IDs of the conversations for which posting is expected. The resource
IDs must be the resource IDs assigned on the initial ALLOCATE for the
conversations or assigned by an incoming ATTACH. The variable length
field is in the format:
- Resource ID, which is 4 bytes repeated for each conversation.
- Delimiter, which is 4 bytes of binary zeros.
- Note:
- This list can contain as many as 20 entries, which allows space for 19
resource IDs and the delimiter.
- rcode
- This is a pointer to the structure tppc_return_codes, defined
in tppc.h, where the return code is to be placed.
- respstd
- This is a pointer to a 4-byte field where the resource ID of a posted
conversation is returned.
Return Codes
The following table contains a list of the primary and secondary return
codes that can be returned to the program that called the tppc_wait
function. A complete list of the return codes and their definitions can
be found in Table 37 and Table 38.
Symbolic Name
| Primary Code
| Secondary Code
|
LU62RC_OK
| 0000
|
|
LU62RC_POSTED_DATA
| ....
| 00000000
|
LU62RC_POSTED_NOTDATA
| ....
| 00000001
|
LU62RC_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_TCBID
| ....
| 00000001
|
LU62RC_PK_BAD_CONVID
| ....
| 00000002
|
LU62RC_PK_EMPTY_RESIDL
| ....
| 00000003
|
LU62RC_STATE_CHECK
| 0002
|
|
LU62RC_NOT_RCV_STATE
| ....
| 00000122
|
LU62RC_ALLOC_ERROR
| 0003
|
|
LU62RC_SECURITY_NOT_VALID
| ....
| 080F6051
|
LU62RC_TP_NOT_AVAIL_RETRY
| ....
| 084B6031
|
LU62RC_TP_NOT_AVAIL_NO_RETRY
| ....
| 084C0000
|
LU62RC_TPN_NOT_RECOGNIZED
| ....
| 10086021
|
LU62RC_PIP_NOT_SPECIFIED_CORRECTLY
| ....
| 10086032
|
LU62RC_CONV_TYPE_MISMATCH
| ....
| 10086034
|
LU62RC_SYNLVL_NOTSUPORT
| ....
| 10086041
|
LU62RC_DLLOC_ABEND_PGM
| 0006
|
|
LU62RC_DLLOC_ABEND_SVC
| 0007
|
|
LU62RC_DLLOC_ABEND_TMR
| 0008
|
|
LU62RC_DLLOC_NORMAL
| 0009
|
|
LU62RC_POSTING_NOTACTIV
| 000B
|
|
LU62RC_PGMERR_NOTRUNC
| 000C
|
|
LU62RC_PGMERR_TRUNC
| 000D
|
|
LU62RC_PGMERR_PURGING
| 000E
|
|
LU62RC_CONVFAIL_RETRY
| 000F
|
|
LU62RC_CONVFAIL_NORETRY
| 0010
|
|
LU62RC_SVCERR_NOTRUNC
| 0011
|
|
LU62RC_SVCERR_TRUNC
| 0012
|
|
LU62RC_SVCERR_PURGING
| 0013
|
|
LU62RC_TPF_ABEND
| FFFF
|
|
Programming Considerations
- The conversation must be in receive state.
- The values supplied in residl must be the resource IDs returned
by the tppc_allocate function or IDs that were assigned by an
incoming ATTACH.
- This function is intended to be used in conjunction with the
tppc_post_on_receipt function. The use of these functions
allows a program to perform synchronous receiving from multiple
conversations. The program calls tppc_post_on_receipt for
each conversation and then calls this function for all the conversations in
the resource list. The WAIT is satisfied when any conversation in the
list has information available to be received.
- The value returned in respstd is one of the resource IDs
specified in residl. The resource ID returned identifies the
conversation that was posted.
- The return code indicates the posting state for the conversation
identified in the respstd parameter. A secondary return code
of LU62RC_POSTED_DATA indicates that a data message is available for
receipt. A secondary return code of LU62RC_POSTED_NOTDATA indicates
that information other than a data message is available, such as a
confirmation request of a SEND indication.
- Posting is reset for the conversation returned in the respstd
parameter. The TPF transaction program must call the
tppc_receive function in order to receive the available
information.
- Posting may or may not be active for the resource IDs specified in
residl. This function waits for posting to occur on any
conversation's resource ID in the list that has posting active.
- This function uses TPF's EVENT and POST facility to suspend the ECB
until posting occurs on one of the conversations. Since the ECB is
suspended, all unnecessary resources should be released before calling this
verb. Failure to do so can cause serious system performance
degradation.
- If posting does not occur within a certain amount of time, TPF/APPC
support issues a tppc_deallocate with
DEALLOCATE_TYPE_ABENDP to terminate all the conversations in the
list. The amount of time that the system waits is determined by the
value you specify for the TPWAIT parameter on the SNAKEY macro. See
TPF ACF/SNA Network Generation for information about
the SNAKEY macro.
- See Programming Considerations for Basic Conversation Functions for additional programming considerations relating to the
TPF/APPC basic conversation functions.
Examples
The following example waits for posting to occur on any one of a list of
conversations.
#include <tppc.h>
unsigned int resource_id_list[10];
struct tppc_return_codes return_code;
unsigned int posted_resource_id;
·
·
·
resource_id_list[0] = conversation_1;
resource_id_list[1] = conversation_2;
resource_id_list[2] = conversation_3;
resource_id_list[3] = 0;
/* zero resource id indicates the end of the list. */
·
·
·
tppc_wait(resource_id_list,&return_code,&posted_resource_id);
/* normal processing path */
·
·
·
Related Information