HP-UX SNAplus2 MS Programmer's Guide
Writing MS Applications
Description of the MS API Entry Points
Chapter 238
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 specifies 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 ms_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 thatthe asynchronous verb has
already completed.
The Callback Routine Specified on the ms_async
Entry Point
When using the asynchronous MS API entry point, the application must
supply a pointer to a callback routine. SNAplus2 uses this callback
routine both for completion of a verb and also for returning MS data and
status indications. The application must examine the
opcode
parameter
in the VCB to determine which event is contained in the callback
routine.
This section describes how SNAplus2 uses the callback routine and the
functions that the callback routine must perform.
Callback Function
MS_CALLBACK (*comp_proc);
typedef void (*MS_CALLBACK) (
unsigned long target_handle,