The following example of a mapped conversation shows the CPI-C calls used to start a conversation, exchange data, and end the conversation. Call parameters are in parentheses.
Issued by the invoking TP | Issued by the invokable TP |
---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The following paragraphs describe the calls that are used in a mapped conversation.
To start a conversation, the invoking TP issues the following calls:
The invokable TP issues the Accept_Conversation call, which informs CPI-C that it is ready to begin a conversation with the invoking TP.
The Send_Data call 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 addition to the data record, the send buffer also contains the allocation request (which precedes the data record).
In the preceding example, Deallocate flushes the send buffer, sending the allocation request and data to the partner TP. Other calls that flush the buffer are Confirm and Flush.
The Receive call receives the data record and status information from the partner TP. If no data or status information is currently available, the local TP, by default, waits for data to arrive.
The data_received parameter of Receive tells the program whether it received data and if so, whether or not the data is complete.
To end a conversation, one of the TPs issues Deallocate, which causes CPI-C to deallocate the conversation between the two TPs.