HP-UX SNAplus2 R7 APPC Programmer's Guide
APPC Conversation Verbs
MC_TEST_RTS_AND_POST and TEST_RTS_AND_POST
• Callback routine
• Processing while the verb is pending
• How the TP uses the verb
• Avoiding indefinite waits
Callback Routine
UNIX
The application supplies a pointer to a callback routine as one of the parameters to the VCB. This section describes
how SNAplus2 uses this routine, and the functions that it must perform.
The callback routine is defined as follows:
void (*callback) (
void * vcb,
unsigned char tp_id[8],
AP_UINT32 conv_id
);
SNAplus2 calls the routine with the following parameters:
vcb
Pointer to the VCB supplied by the application, including the returned parameters set by SNAplus2.
tp_id
The 8-byte TP identifier of the TP in which the verb was issued.
conv_id
The conversation identifier of the conversation in which the verb was issued.
The callback routine need not use all of these parameters. It may perform all the necessary processing on the
returned VCB, or may simply set a variable to inform the main program that the verb has completed.
The application can issue further APPC verbs from within the callback routine, if required. However, these must
be asynchronous verbs. Any synchronous verbs issued from within a callback routine will be rejected with the re-
turn codes
AP_PARAMETER_CHECK and AP_SYNC_NOT_ALLOWED.
Note
If the application issues the [MC_]TEST_RTS_AND_POST verb using the asynchronous
APPC entry point, there are two callback routines specified: one in the VCB, the other
supplied as a parameter to the entry point. In general, APPC uses the callback routine
specified in the VCB and ignores the one on the entry point; however, if the application
supplies a null pointer for the callback routine in the VCB, APPC uses the callback routine
on the entry point.
Continuing with Other Processing While the Verb Is Pending
Because the [MC_]TEST_RTS_AND_POST verb returns immediately without waiting for data to arrive, the TP
can continue other processing while waiting for it to complete. However, the following points should be noted:
• The VCB supplied to the [MC_]TEST_RTS_AND_POST verb continues to be used until the callback routine
returns. The TP must not change any fields in the VCB during this time. If it issues any other APPC verb while
[MC_]TEST_RTS_AND_POST is outstanding, it must use another VCB for the new verb.
247