gtpc2maf | C/C++ Language Support User's Guide |
This function changes the conversation from send to
receive state in preparation to receive data. The change to
receive state is completed as part of this function. The
execution of this function includes the function of the FLUSH or CONFIRM
verb.
Format
#include <tppc.h>
void tppc_prepare_to_receive(unsigned int *resid,
struct tppc_return_codes *rcode,
enum t_prepare_to_receive_type type,
enum t_prepare_to_receive_locks locks);
- resid
- This is a pointer to a 4-byte field that contains the resource ID.
This resource ID must be the ID assigned on the initial ALLOCATE for this
conversation or one that was assigned by an incoming ATTACH.
- rcode
- This is a pointer to the structure tppc_return_codes, defined
in tppc.h, where the return code is to be placed.
- type
- This specifies the type of PREPARE_TO_RECEIVE to be done on this
conversation. This argument must belong to the enumeration type
t_prepare_to_receive_type, defined in
tppc.h. Use one of the following values:
- PREP_TO_RECEIVE_TYPE_CONFIRM
- This executes the function of the CONFIRM verb. When the
PREPARE_TO_RECEIVE request completes successfully, the conversation enters
receive state.
- PREP_TO_RECEIVE_TYPE_SYNC
- This executes the function of the FLUSH verb or the CONFIRM verb based on
the synchronization level of the conversation. If the synchronization
level is NONE, a FLUSH is performed. If the synchronization
level is CONFIRM, a CONFIRM is performed.
- locks
- This argument must belong to the enumeration type
t_prepare_to_receive_locks, defined in
tppc.h. Use the value
PREP_TO_RECEIVE_LOCKS_SHORT. This parameter is meaningful only
when the PREP_TO_RECEIVE_TYPE_CONFIRM option is used or implied on
the type parameter, and it causes control to be returned only after
the confirmation reply was received. Although this parameter has no
meaning with other options, it still must be coded.
- Note:
- The TPF system does not support the LONG option defined by the LU 6.2
architecture.
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_prepare_to_receive 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_PARAMETER_CHECK
| 0001
|
|
LU62RC_PK_BAD_TCBID
| ....
| 00000001
|
LU62RC_PK_BAD_CONVID
| ....
| 00000002
|
LU62RC_PKPTRCV_INVTYPE
| ....
| 000000A1
|
LU62RC_PK_BAD_OPTION
| ....
| 00C62074
|
LU62RC_STATE_CHECK
| 0002
|
|
LU62RC_SKPTRCV_BADSTATE
| ....
| 000000A3
|
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_PGMERR_PURGING
| 000E
|
|
LU62RC_CONVFAIL_RETRY
| 000F
|
|
LU62RC_CONVFAIL_NORETRY
| 0010
|
|
LU62RC_SVCERR_PURGING
| 0013
|
|
LU62RC_TPF_ABEND
| FFFF
|
|
Programming Considerations
- The conversation must be in send state.
- The value supplied in resid must be the resource ID returned by
the tppc_allocate function or one that was assigned by an incoming
ATTACH.
- Upon successful completion of this function, the conversation is in
receive state.
- If the type=PREP_TO_RECEIVE_TYPE_CONFIRM option is specified,
TPF's EVENT and POST facility is used to suspend the ECB until the
program receives the confirmation reply. Since the ECB is suspended,
all unnecessary resources should be released before this verb is
issued. Failure to do so can cause serious system degradation.
- Note:
- You can avoid the problem of suspended ECBs by using the
tppc_activate_on_confirmation function instead of
tppc_prepare_to_receive. See tppc_activate_on_confirmation-Activate a Program after Confirmation Received for more information.
- If the type=PREP_TO_RECEIVE_TYPE_CONFIRM option is specified and
the program does not receive a confirmation reply within a certain amount of
time, TPF/APPC support issues a tppc_deallocate with
DEALLOCATE_TYPE_ABENDP to terminate the conversation. The
amount of time that the system waits is determined by the value you specify
for the TPRECV parameter on the SNAKEY macro. See the TPF ACF/SNA Network Generation for information about the
SNAKEY macro.
- The remote transaction program enters the corresponding send
state when it receives the SEND indication in the WHAT_RECEIVED
(whatrcv) parameter. (See tppc_receive-Receive Information) The remote transaction program can then send
data to the local TPF transaction program.
- See Programming Considerations for Basic Conversation Functions for additional programming considerations relating to the
TPF/APPC basic conversation functions.
Examples
The following example changes the direction of the conversation.
#include <tppc.h>
unsigned int resource_id;
struct tppc_return_codes return_code;
·
·
·
/* set up resource_id with the value returned from the allocate verb */
·
·
·
tppc_prepare_to_receive(&resource_id,&return_code, \
PREP_TO_RECEIVE_TYPE_SYNC,PREP_TO_RECEIVE_LOCKS_SHORT);
/* normal processing path */
·
·
·
Related Information