Changing Conversation States

A change in the conversation state can result from:

The following example shows how APPC verbs can change the state of the conversation from SEND to RECEIVE and from RECEIVE to SEND.

Note  Any TP can send or receive data, regardless of whether it is the invoking TP (the TP that started the conversation) or the invokable TP (the TP that responded to a request to start a conversation).

This example shows how APPC verbs can change the conversation state. In this table, each conversation state appears in bold and precedes the APPC verbs that are used while in that state.

Issued by the invoking TP Issued by the invokable TP
TP_STARTED
Conversation state: RESET
MC_ALLOCATE
(synclevel=AP_CONFIRM_SYNC_LEVL)
Conversation state: SEND
MC_SEND_DATA
MC_PREPARE_TO_RECEIVE
(ptr_type=AP_SYNC_LEVEL)
Conversation state: RESET
RECEIVE_ALLOCATE
Conversation state: RECEIVE
MC_RECEIVE_AND_WAIT
(primary_rc=AP_OK)
(what_rcvd=AP_DATA_COMPLETE)
MC_RECEIVE_AND_WAIT
(primary_rc=AP_OK)
(what_rcvd=AP_CONFIRM_SEND)
Conversation state: CONFIRM_SEND
MC_CONFIRMED
Conversation state: SEND
MC_SEND_DATA
MC_CONFIRM
Conversation state: RECEIVE
MC_RECEIVE_AND_WAIT
(primary_rc=AP_OK)
(what_rcvd=AP_DATA_COMPLETE)
MC_RECEIVE_AND_WAIT
(primary_rc=AP_OK)
(what_rcvd=AP_CONFIRM_WHAT_RECEIVED)
Conversation state: CONFIRM
MC_REQUEST_TO_SEND
MC_CONFIRMED
(rts_rcvd=AP_YES)
MC_PREPARE_TO_RECEIVE
(ptr_type=AP_SYNC_LEVEL)
Conversation state: RECEIVE
MC_RECEIVE_AND_WAIT
(primary_rc=AP_OK)
(what_rcvd=AP_CONFIRM_SEND)
Conversation state: CONFIRM_SEND
MC_CONFIRMED
Conversation state: SEND
MC_SEND_DATA
MC_DEALLOCATE
(dealloc_type=AP_SYNC_LEVEL)
Conversation state: RECEIVE
MC_RECEIVE_AND_WAIT
(primary_rc=AP_OK)
(what_rcvd=AP_DATA_COMPLETE)
MC_RECEIVE_AND_WAIT
(primary_rc=AP_OK)
(what_rcvd=AP_CONFIRM_DEALLOCATE)
Conversation state: CONFIRM_DEALLOCATE
MC_CONFIRMED
Conversation state: RESET Conversation state: RESET
TP_ENDED
TP_ENDED

Initial States

Before the conversation is allocated, the state is RESET for both TPs.

In the example, after the conversation is allocated, the initial state is SEND for the invoking TP and RECEIVE for the invokable TP.

Changing to RECEIVE State

MC_PREPARE_TO_RECEIVE allows a TP to change the conversation from SEND to RECEIVE state. This verb:

Confirmation processing is performed when the following conditions are true:

For more information about confirmation processing, see Confirmation Processing.

Important  Issuing MC_RECEIVE_AND_WAIT while the conversation is in SEND state flushes the LU's send buffer and changes the conversation state to RECEIVE. Changing the conversation state in this manner does not support confirmation processing.

Changing to SEND State

MC_REQUEST_TO_SEND informs the partner TP (for which the conversation is in SEND state) that the local TP (for which the conversation is in RECEIVE state) wants to send data. This request is communicated to the partner TP through the rts_rcvd parameter of MC_CONFIRM. (The rts_rcvd parameter is also returned to MC_SEND_DATA and other verbs.)

When the partner TP issues MC_PREPARE_TO_RECEIVE, the conversation state changes to RECEIVE for the partner TP, making it possible for the local TP to send data.

Important  Issuing MC_REQUEST_TO_SEND does not change the state of the conversation. Upon receiving a request to send, the partner TP is not required to change the conversation state; it can ignore the request.