HP-UX SNAplus2 R7 APPC Programmer's Guide

APPC Conversation Verbs
MC_RECEIVE_AND_POST and RECEIVE_AND_POST
vcb
Pointer to the VCB supplied by the application, including the returned parameters set by SNAplus2.
tp_id
The 8-byte TP identier of the TP in which the verb was issued.
conv_id
The conversation identier 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 return
codes
AP_PARAMETER_CHECK
and AP_SYNC_NOT_ALLOWED.
If the application issues the [MC_]RECEIVE_AND_POST verb using the asynchronous APPC entry point, there
are two callback routines specied: one in the VCB, the other supplied as a parameter to the entry point. In
general, APPC uses the callback routine specied 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.This ensures compatibility with the asynchronous interface in previous versions of SNAplus2, where the
callback routine in the VCB was reserved.
Continuing with Other Processing While the Verb Is Pending
Because the [MC_]RECEIVE_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_]RECEIVE_AND_POST verb continues to be used until the callback routine
returns. The TP must not change any elds in the VCB during this time. If it issues any other APPC verb while
in Pending_Post state, it must use another VCB for it.
Only one [MC_]RECEIVE_AND_POST verb per conversation can be active at any time.
Compatibility with Other APPC Implementations
UNIX
The HP-UX implementation of the [MC_]RECEIVE_AND_POST verb is different from OS/2 APPC implemen-
tations. In addition, this verb is not available in any DOS implementations of APPC. Because of this, TPs using
[MC_]RECEIVE_AND_POST are not totally portable to other operating systems; if your TP uses this verb, you
will need to rewrite the sections of the TP that use it if you want the TP to run on other operating systems.
How the TP Uses the Verb
To use the [MC_]RECEIVE_AND_POST verb, the local TP performs the following steps:
1. Issues the [MC_]RECEIVE_AND_POST verb.
2. Checks the value of the primary return code primary_rc.
If the primary return code is
AP_OK, the receive buffer (pointed to by the dptr parameter) is asynchronously
receiving data from the partner TP. While receiving data asynchronously, the local TP can do the following:
Perform tasks not related to this conversation
Issue the [MC_]REQUEST_TO_SEND verb
Gather information about this conversation by issuing the following verbs:
172