|
|
|
|
APPC provides three different verbs which are used to receive data from the partner TP. Most of the parameters and return codes are the same for all three verbs, but each operates in a different way and provides a different function. Common information which applies to all three verbs are explained together in this section; each verb is then explained in detail.
The three RECEIVE verbs are:
[MC_]RECEIVE_IMMEDIATE
[MC_]RECEIVE_AND_WAIT
[MC_]RECEIVE_AND_POST
The process through which the local TP receives data is as follows:
The local TP issues a receive verb until it finishes receiving a complete unit of data. The data received can be any of the following:
One data record transmitted in a mapped conversation
One logical record transmitted in a basic conversation
A buffer of data received independent of its logical-record format in a basic conversation
The local TP may need to issue several RECEIVE verbs in order to receive a complete unit of data. Once a complete unit of data has been received, the local TP can manipulate it.
The local TP issues another receive verb. This has one of the following effects:
If the partner TP has sent more data, the local TP begins to receive a new unit of data.
If the partner TP has finished sending data or is waiting for confirmation, status information (available through the what_rcvd parameter) indicates the next action the local TP normally takes. For more information, see The what_rcvd Parameter.
Alternatively, the local TP can set a parameter rtn_status when issuing the receive verb; this indicates that any status information available is to be returned with the data. In this case, the receive verb that returns the last part of the data also returns the status information, and the local TP does not need to issue a separate receive verb for it. For more information, see The what_rcvd Parameter.
After issuing one of the [MC_]RECEIVE verbs, a TP will normally use
the what_rcvd parameter to determine its next action.
The values referring to a data type of User Control
will be
returned on a mapped conversation on the Solaris system, and
the values referring to a data type of PS Header
will be returned
on a mapped conversation on the Solaris system with a synchronization
level of
The following list describes the possible values of the what_rcvd parameter, with the action normally taken by the TP for each of them:
The local TP received data from the partner TP. It will normally continue to issue RECEIVE verbs until it receives one of the other what_rcvd parameters in this list.
The partner TP issued the [MC_]PREPARE_TO_RECEIVE verb without requesting confirmation, or issued the [MC_]SEND_DATA verb with a send type of PREPARE_TO_RECEIVE. The local TP is now in Send state, so it will normally begin to send data.
The partner TP issued the [MC_]DEALLOCATE verb with a dealloc_type parameter indicating that confirmation was required, or issued the [MC_]SEND_DATA verb with a send type of DEALLOCATE. The local TP is now in Confirm_Deallocate state, so it will normally issue the [MC_]CONFIRMED verb to confirm deallocation of the conversation.
The partner TP issued the [MC_]PREPARE_TO_RECEIVE verb with ptr_type and dealloc_type parameters indicating that confirmation was required, or issued the [MC_]SEND_DATA verb with a send type of PREPARE_TO_RECEIVE_CONFIRM. The local TP is now in Confirm_Send state, so it will normally issue the [MC_]CONFIRMED verb to confirm the state change and then begin to send data.
The partner TP issued the [MC_]CONFIRM verb, or issued the [MC_]SEND_DATA verb with a send type of CONFIRM. The local TP is now in Confirm state, so it will normally issue the [MC_]CONFIRMED verb.
The following values will only be returned if the local TP specified
The partner TP sent data and then issued the [MC_]PREPARE_TO_RECEIVE verb without requesting confirmation, or issued the [MC_]SEND_DATA verb with a send type of PREPARE_TO_RECEIVE. The local TP is now in Send_Pending state, so it will normally begin to send data.
The partner TP sent data and then issued the [MC_]DEALLOCATE verb with a dealloc_type parameter indicating that confirmation was required, or issued the [MC_]SEND_DATA verb with a send type of DEALLOCATE. The local TP is now in Confirm_Deallocate state, so it will normally issue the [MC_]CONFIRMED verb to confirm deallocation of the conversation.
The partner TP sent data and then issued the [MC_]PREPARE_TO_RECEIVE verb with ptr_type and dealloc_type parameters indicating that confirmation was required, or issued the [MC_]SEND_DATA verb with a send type of PREPARE_TO_RECEIVE_CONFIRM. The local TP is now in Confirm_Send state, so it will normally issue the [MC_]CONFIRMED verb to confirm the state change and then begin to send data.
The partner TP sent data and then issued the [MC_]CONFIRM verb, or issued the [MC_]SEND_DATA verb with a send type of CONFIRM. The local TP is now in Confirm state, so it will normally issue the [MC_]CONFIRMED verb.
In all CONFIRM cases above, the TP may issue the [MC_]SEND_ERROR verb instead of the [MC_]CONFIRMED verb, to indicate that an error was detected in the supplied data or in processing. If it issues [MC_]SEND_ERROR in Send_Pending state (after receiving AP_DATA_SEND, AP_DATA_COMPLETE_SEND, AP_UC_DATA_COMPLETE_SEND , or AP_PS_HDR_COMPLETE_SEND), it can specify whether the error was detected in the supplied data, or in its own data or processing. For more information, see the description of the [MC_]SEND_ERROR verb in MC_SEND_ERROR and SEND_ERROR.
If the local TP issues one of the basic-conversation RECEIVE verbs and
sets the fill parameter to
A primary_rc parameter with a value other than AP_OK (for example, AP_DEALLOC_NORMAL )
A what_rcvd parameter that includes SEND, CONFIRM, CONFIRM_SEND, or CONFIRM_DEALLOCATE
To determine if end of data has been reached, the local TP reissues one of the RECEIVE verbs. If the new primary_rc parameter contains AP_OK and what_rcvd contains AP_DATA or AP_DATA_INCOMPLETE , end of data has not been reached. If, however, end of data has been reached, the primary_rc or what_rcvd parameter will indicate the cause of the end of data.
The local TP can use any of the [MC_]RECEIVE verbs to determine whether the partner TP has data to send, seeks confirmation, or has changed the conversation state, without receiving any data. To do this, it issues the [MC_]RECEIVE verb with the max_len parameter set to 0 (zero), and then (if the verb returns with a primary_rc of AP_OK) tests the what_rcvd parameter.
|
|
|
|
|