HP-UX SNAplus2 R7 APPC Programmer's Guide

Writing Transaction Programs
APPC Entry Points: HP-UX Systems
Returned Values
The asynchronous entry point returns one of the following values:
AP_COMPLETED
The verb has already completed. The application can examine the parameters in the VCB to determine
whether the verb completed successfully. SNAplus2 does not call the supplied callback routine for this verb.
AP_IN_PROGRESS
The verb has not yet completed. The application can continue with other processing, including issuing other
APPC verbs, provided that they do not depend on the completion of the current verb. However, the application
should not attempt to examine or modify the parameters in the VCB supplied to this verb.
SNAplus2 calls the supplied callback routine to indicate when the verb processing completes. The application
can then examine the VCB parameters.
Using the Asynchronous Entry Point
When using the asynchronous entry point, note the following:
If an application species a null pointer in the
comp_proc parameter, the verb will complete synchronously (as
though the application issued the verb using the synchronous entry point).
If the call to
APPC_Async is made from within an application callback, specifying a null pointer in the
comp_proc parameter is not permitted. In such cases, SNAplus2 rejects the verb with primary return code value
AP_PARAMETER_CHECK
and secondary return code value
AP_SYNC_NOT_ALLOWED.
The application must not attempt to use or modify any parameters in the VCB until the callback routine has
been called.
Multiple verbs do not necessarily complete in the order in which they were issued. In particular, if an application
issues an asynchronous verb followed by a synchronous verb, the completion of the synchronous verb does not
guarantee that the asynchronous verb has already completed.
The [MC_]RECEIVE_AND_POST verb includes a pointer to a callback routine as one of the VCB parameters.
This verb can be issued using either the synchronous or the asynchronous entry point. SNAplus2 uses the
callback routine specied in the VCB to return the results of this verb. The callback routine specied on the
asynchronous entry point is used only if the application supplies a null pointer for the callback routine in the
VCB.
2.3.3 Callback Routine for Asynchronous Verb Completion
When using the asynchronous entry point, the application must supply a pointer to a callback routine. This section
describes how SNAplus2 uses this routine, and the functions that it must perform.
Function Call
AP_CALLBACK (*comp_proc);
typedef void (*AP_CALLBACK) (
void * vcb,
unsigned char tp_id[8],
AP_UINT32 conv_id,
AP_CORR corr
);
typedef union ap_corr {
void * corr_p;
AP_UINT32 corr_l;
AP_INT32 corr_i;
} AP_CORR;
52