For background information about mapped conversations, see Basic and Mapped Conversations Compared.
The following example of a mapped conversation shows the APPC verbs used to start a conversation, exchange data, and end the conversation. APPC verb parameters are in parentheses.
Issued by the invoking TP | Issued by the invokable TP |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following paragraphs describe the verbs that are used in a mapped conversation.
To start a mapped conversation, the invoking TP issues the following verbs:
The invokable TP issues RECEIVE_ALLOCATE, which informs APPC that it is ready to begin a conversation with the invoking TP.
MC_SEND_DATA puts one data record (a record containing application data to be transmitted) in the send buffer of the local LU. Data transmission to the partner TP does not happen until one of the following events occurs:
In the preceding example, the send buffer contains both the data record and the MC_ALLOCATE request (which precedes the data record). Therefore, in the example, MC_DEALLOCATE flushes the buffer, sending the MC_ALLOCATE request and data record to the partner TP. Other verbs that flush the buffer are MC_CONFIRM and MC_FLUSH.
The MC_RECEIVE_AND_WAIT verb allows a TP to receive a data record or status information. If no data is currently available, the TP waits for data to arrive. For Windows NT, Windows 95, and Windows 3.x systems, issue MC_RECEIVE_AND_WAIT in conjunction with WinAsyncAPPC rather than the blocking version of this call.
In the example, the receiving TP issues MC_RECEIVE_AND_WAIT twice. The first time, it issues the verb to receive data. When it finishes receiving the complete data record (what_rcvd is AP_DATA_COMPLETE), it issues MC_RECEIVE_AND_WAIT again to receive a return code. The return code ap_dealloc_normal indicates that the conversation has been deallocated.
Note MC_RECEIVE_IMMEDIATE performs the same function as MC_RECEIVE_AND_WAIT, 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.
To end a mapped conversation, one of the TPs issues MC_DEALLOCATE, which causes APPC to deallocate the conversation between the two TPs.
After the conversation has been deallocated, both TPs issue TP_ENDED.
Note A TP can participate in multiple conversations simultaneously. In this case, the TP issues TP_ENDED after all conversations have been deallocated.