gtpc2mae | C/C++ Language Support User's Guide |
This function causes the conversation to be posted when information is
available for the transaction program to receive. The information may
be data or conversation information. The tppc_wait function
should be called after this function in order to wait for posting to
occur. Alternatively, tppc_test can be called after this
function in order to determine when posting has occurred.
Format
#include <tppc.h>
void tppc_post_on_receipt(unsigned int *resid,
struct tppc_return_codes *rcode,
enum t_post_on_receipt_fill fill,
unsigned short int *length);
- 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.
- fill
- This argument must belong to the enumeration type
t_post_on_receipt_fill, defined in tppc.h.
Use the value POST_ON_RECEIPT_FILL_LL, which specifies that posting
occurs when a complete or truncated logical record is received, or when a part
of a logical record is received that is at least equal in length to that
specified on the length parameter.
- Note:
- The TPF system does not support the BUFFER option defined by the LU
6.2 architecture.
- length
- This is a pointer to a 2-byte field that specifies the minimum amount of
data the LU must receive before the conversation can be posted. Use
length along with the fill argument to determine when to
post the conversation for the receipt of data. If the value is a NULL
pointer, the conversation is posted when a complete logical record is received
or other, nondata, information is received (such as CONFIRM or
PREPARE_TO_RECEIVE).
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_post_on_receipt 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_PK_BAD_OPTION
| ....
| 00C62074
|
LU62RC_INVALID_LENGTH
| ....
| 00000006
|
LU62RC_STATE_CHECK
| 0002
|
|
LU62RC_SKPOSTR_BADSTATE
| ....
| 00000092
|
LU62RC_TPF_ABEND
| FFFF
|
|
Programming Considerations
- The conversation must be in receive 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.
- This verb is intended for use in conjunction with the tppc_wait
or tppc_test function. Use this function followed by a
tppc_wait function to allow a transaction program to perform
synchronous receiving from multiple conversations. For each
conversation, the program issues this verb and then issues the
tppc_wait function. This causes the conversations to wait
until information is available to be received.
Use this function followed by a tppc_test function to allow a
transaction program to continue its processing and test the conversation to
determine when information is available to be received.
- Posting becomes active for a conversation when
tppc_post_on_receipt is called for a conversation. Posting
is reset when one of the following functions is called for a conversation
after the conversation is posted:
tppc_deallocate
tppc_receive
tppc_send_error
tppc_test
tppc_wait.
Posting is canceled when one of the following functions is called for a
conversation before the conversation is posted:
tppc_deallocate
tppc_send_error.
- Posting occurs when a complete logical record is available for the
conversation, when the amount of data specified on the length
parameter is available, or when information other than data is received, such
as a confirmation request or an error indication. See the WHAT_RECEIVED
(whatrcv) parameter of the tppc_receive function for more
information. (See tppc_receive-Receive Information.)
- If the length parameter is used, the maximum length that can be
entered is 32,767.
- See Programming Considerations for Basic Conversation Functions for additional programming considerations relating to the
TPF/APPC basic conversation functions.
Examples
The following example causes the conversation to be posted when information
is available for the transaction program to receive.
#include <tppc.h>
unsigned int resource_id;
struct tppc_return_codes return_code;
unsigned short int length;
·
·
·
/* set up resource_id with the value returned from the allocate verb */
·
·
·
tppc_post_on_receipt(&resource_id,&return_code,POST_ON_RECEIPT_FILL_LL, \
&length);
/* normal processing path */
·
·
·
Related Information