HP-UX SNAplus2 R7 APPC Programmer's Guide

Concepts
Receiving Data Asynchronously
Synchronous entry point, APPC. If the application uses this entry point, SNAplus2 does not return control to
the application until verb processing has nished.
Asynchronous entry point, WinAsyncAPPC. If the application uses this entry point, SNAplus2 returns control to
the application immediately. When verb processing has nished, SNAplus2 indicates this by posting a message
to the applications window procedure.
Asynchronous entry point, WinAsyncAPPCEx. When verb processing has nished, SNAplus2 indicates this
by signaling an event handle provided by the application.
For more information about these entry points, see Chapter 2, Writing Transaction Programs.
Using the asynchronous entry point enables an application to continue with other processing while waiting for
a verb to complete. The application may issue verbs on other APPC conversations, or issue verbs to start new
conversations, or it may perform other processing not related to APPC. However, other verbs issued on the same
conversation may be queued and not processed until the outstanding verb has completed; for more information, see
Section 1.11, Non-Blocking Operation below.
The only exception to this is when the [MC_]RECEIVE_AND_POST verb is outstanding. In these cases, the
application can issue a limited range of verbs on the same conversation. For more information, see the following
section.
1.10 Receiving Data Asynchronously
The APPC verbs MC_RECEIVE_AND_POST and RECEIVE_AND_POST enable a TP to receive data asynchro-
nously, without regard for other events occurring within the program. Therefore, the program can perform other
tasks while receiving data.
UNIX
For HP-UX systems, the parameters for [MC_]RECEIVE_AND_POST include the address of a callback routine,
which APPC uses to inform the TP when data has been received. This callback routine is independent of the
callback routine supplied on the asynchronous APPC entry point. [MC_]RECEIVE_AND_POST may be issued
using either the synchronous or the asynchronous entry point; APPC uses the callback routine supplied in the verb
parameters to return received data to the TP and uses the callback routine supplied to the asynchronous entry point
only if a null address is supplied in the VCB.
WINDOWS
On Win32 systems, verb completion is by signaling an event handle provided by the application. The sema
parameter contains the event handle (obtained by calling either the Windows CreateEvent or OpenEvent
functions), which APPC uses to inform the TP when data has been received.
The [MC_]RECEIVE_AND_POST verb is not supported on Win16 systems. Instead, Win16 applications should
use [MC_]RECEIVE_AND_WAIT issued to the asynchronous entry point, which provides the same function.
The operation of [MC_]RECEIVE_AND_POST is similar to the operation of [MC_]RECEIVE_AND_WAIT issued
using the asynchronous entry point; control returns to the application immediately, and the requested data is
subsequently returned on the callback routine. The main difference is that issuing [MC_]RECEIVE_AND_POST
puts the conversation into a dened state, Pending-Post state, in which the TP can issue a limited range of APPC
verbs on this conversation while waiting for the callback routine to be called. The verbs that can be issued in
Pending-Post state are:
GET_TYPE
37