Previous Page Contents Page Next Page

1.2 A Simple Mapped Conversation

A Simple Mapped Conversation shows an example of a simple mapped conversation showing the APPC verbs used to start a conversation, exchange data, and end the conversation. The arrow indicates the flow of data. All primary_rc values are AP_OK unless shown otherwise.

A Simple Mapped Conversation

Invoking TPFlowInvoked TP
TP_STARTED
MC_ALLOCATE
MC_SEND_DATA
MC_DEALLOCATE
->
TP_ENDED RECEIVE_ALLOCATE
MC_RECEIVE_AND_WAIT (what_rcvd = AP_DATA_COMPLETE)
MC_RECEIVE_AND_WAIT (primary_rc = AP_DEALLOC_NORMAL)
TP_ENDED

The characters MC_ at the beginning of many of the verbs stand for mapped conversation. Parameters and results of APPC verbs are in parentheses.

1.2.1 Starting a Conversation

To start a conversation, the invoking TP issues the following verbs:

The invoked TP issues the RECEIVE_ALLOCATE verb, which informs APPC that the invoked TP is ready to begin a conversation. SNAP-IX associates the RECEIVE_ALLOCATE verb with the MC_ALLOCATE verb issued by the invoking TP in order to establish the conversation between the two TPs.

1.2.2 Sending Data

The MC_SEND_DATA verb supplies application data to be transmitted to the partner TP. This data is held in the local LU's send buffer; it is not transmitted to the partner TP until one of the following events occurs:

In addition to the data, the send buffer also contains the MC_ALLOCATE request (which precedes the data). In this example, the MC_DEALLOCATE verb flushes the buffer, transmitting the MC_ALLOCATE request and data to the partner TP. Other verbs that flush the buffer are MC_CONFIRM and MC_FLUSH.

1.2.3 Receiving Data

The MC_RECEIVE_AND_WAIT verb receives data from the partner TP. If no data is currently available, the local TP waits for it to arrive.

As well as receiving data, the verb may receive a status indicator from the partner TP (such as an indication that the conversation is ending, a request to confirm receipt of data, and so on). For more information about how the TP handles these indicators, see Confirmation Processing and Conversation States.

In the example, the invoked TP issues the first MC_RECEIVE_AND_WAIT verb to receive data. When it has finished receiving the complete data record (what_rcvd= AP_DATA_COMPLETE), it issues the MC_RECEIVE_AND_WAIT verb again to receive a return code. The return code AP_DEALLOC_NORMAL indicates that the conversation was deallocated.

The MC_RECEIVE_IMMEDIATE verb performs the same function as the MC_RECEIVE_AND_WAIT verb, except that it does not wait if data is not currently available from the partner TP. Instead, it returns a no-data-available response to the calling TP.

1.2.4 Ending a Conversation

To end a conversation, one of the TPs issues the MC_DEALLOCATE verb, which causes APPC to deallocate the conversation between the two TPs.

After this conversation is deallocated, each TP either issues another [MC_]ALLOCATE or RECEIVE_ALLOCATE verb to start another conversation (with this or another partner TP), or issues the TP_ENDED verb.

A TP can participate in multiple conversations simultaneously. In this case, the TP issues the TP_ENDED verb when all conversations have been deallocated.

Previous Page Contents Page Top of Page Next page