Previous Page Contents Page Next Page

1.5 Changing Conversation States

In Changing Conversation States, the conversation states appear in the left and right margins. This table shows how CPI-C calls can change the state of the conversation from Send to Receive and from Receive to Send.

Changing Conversation States

State Invoking ProgramInvoked ProgramState
Reset
Initialize_Conversation
Initialize
Set_Sync_Level
( sync_level=CM_CONFIRM)
Allocate
Send
Send_Data
Prepare_To_Receive Reset
->
Accept_Conversation
Receive
Receive
( status_received=CM_CONFIRM_SEND_RECEIVED)
Confirm-Send
Confirmed
<-
Send
( return_code=CM_OK)
Receive
Send_Data
Confirm
<-
Receive

( status_received=

CM_CONFIRM_RECEIVED )

Confirm
Request_To_Send
Confirmed
->
Receive
( return_code=CM_OK)

( request_to_send_received=

CM_REQ_TO_SEND_RECEIVED )

Prepare_To_Receive
<-
Receive

( status_received=

CM_CONFIRM_SEND_RECEIVED )

Confirm-Send
Confirmed
->
Send
( return_code=CM_OK)
Receive
Send_Data
Deallocate
->
Receive

( status_received=

CM_CONFIRM_DEALLOC_RECEIVED )

Confirm-Deallocate
Confirmed
<-
Reset
( return_code=CM_OK)
Reset

1.5.1 Initial States

Before the conversation is allocated, both programs are in Reset state.

After the conversation is allocated, the initial state is Send for the invoking program and Receive for the invoked program.

1.5.2 Changing to Receive State

The Prepare_To_Receive call enables a program to change the conversation from Send to Receive state. This call does the following:

1.5.3 Changing to Send State

The conversation state for a program changes from Receive to Send when its partner program begins to receive data (by issuing the Prepare_To_Receive call).

The local program (for which the conversation is in Receive state) can inform the partner program that it wants to send data, by issuing the Request_To_Send call. This request is communicated to the partner program through the request_to_send_received parameter. (In the previous example, this parameter is shown on the Confirm call; it is also returned to Send_Data and other calls.)

Issuing the Request_To_Send call does not change the state of the conversation, because the partner program can ignore it. When the partner program issues the Prepare_To_Receive call, the conversation state changes to Receive for the partner program. The local program receives the SEND indication on a subsequent RECEIVE verb, and can then send data.

Previous Page Contents Page Top of Page Next page