HP-UX SNAplus2 R7 APPC Programmer's Guide
Concepts
Non-Blocking Operation
State Invoking TP Flow Invoked TP State
MC_RECEIVE_AND_POST returns pri-
mary_rc=
AP_OK,
what_rcvd=
AP_DATA_COMPLETE
Receive
(TP checks that the callback routine has
been called.)
MC_RECEIVE_AND_WAIT (pri-
mary_rc=
AP_DEALLOC_NORMAL)
Reset
TP_ENDED
In Table 1–6, Receiving Data Asynchronously, the invoked TP follows these steps to receive data asynchronously:
1. Issues the MC_RECEIVE_AND_POST verb. One of the parameters is the address of the callback routine which
APPC calls (on HP-UX)or event handle which APPC signals (on Windows) when the data is received.
2. Verifies that the primary_rc (primary return code) is
AP_OK, which indicates that the TP has begun to receive
data asynchronously.
3. Performs tasks not related to this conversation while receiving data asynchronously. Most APPC verbs are not
valid in this conversation state.
4. Waits for the callback routine to be called (on HP-UX), or event handle to be signaled (on Windows), which
indicates that the TP has finished receiving data asynchronously.
5. Verifies the primary_rc of the MC_RECEIVE_AND_POST verb again. The second primary_rc indicates whether
the data was received without error.
6. Verifies that the what_rcvd parameter of the MC_RECEIVE_AND_POST verb is
AP_DATA_COMPLETE
.
7. Issues the MC_RECEIVE_AND_WAIT verb to receive the deallocation indicator.
Note
The [MC_]RECEIVE_AND_POST verb returns the primary_rc and secondary_rc parame-
ters twice; first after issuing the verb, to indicate whether or not the verb has successfully
begun to wait for data, and second after the data has been received.
After the invoked TP issues the MC_RECEIVE_AND_POST verb and gets a primary_rc of
AP_OK, the conversation
changes to Pending-Post state.
When the TP has finished receiving data asynchronously and APPC calls the supplied callback routine (on HP-UX)
or signals the supplied event handle (on Windows), the conversation changes to Receive state because the what_rcvd
parameter contains
AP_DATA_COMPLETE.
1.11 Non-Blocking Operation
SNAplus2 supports queue-level non-blocking operation for APPC conversation verbs, so that a TP can issue multiple
verbs on the same conversation without having to wait for each verb to complete. This is normally used in
conjunction with the asynchronous APPC entry point, which allows the TP to continue operation even though
processing for a previous verb has not yet completed, but it may also be used with the synchronous entry point in
39