Previous Page Contents Page Next Page

1.4 Conversation States

The state of the conversation governs which CPI-C calls can be issued by the program. For instance, a program cannot issue the Send_Data call if the conversation is not in Send or Send-Pending state. Possible conversation states are summarized in the list below.

Reset

The conversation has not started or has been terminated.

Initialize

The conversation has been initialized successfully.

Send

The program can send data to the partner program and request confirmation. When the conversation is in Send state, the program can also begin to receive data, which can cause the state to change to Receive.

Send-Pending

The program issued a Receive call and received data as well as a send indicator (status_received = CM_SEND_RECEIVED ), indicating that the program can begin to send data. This state is similar to Send state, except that the program can provide additional information when reporting errors (to indicate whether it detected an error in the received data or in its own processing).

Receive

The program can receive application data and status information from the partner program. When the conversation is in Receive state, the program can also send error information and request permission to send data.

Confirm

The program has received a request for confirmation of receipt of data; it must respond positively or send error information to the partner program.

Confirm-Deallocate

The program has received a request for confirmation and must respond positively or send error information. If the program responds positively, the partner program deallocates the conversation.

Confirm-Send

The program has received a request for confirmation; it must respond positively or send error information. After responding, the program can begin to send data.

Initialize-Incoming

The program has successfully issued Initialize_For_Incoming and obtained a conversation ID. It can now issue Accept_Incoming to accept an incoming conversation.

Pending-Post

The program has successfully issued the Receive call in nonblocking mode. While the call is outstanding, it can issue a limited range of CPI-C calls on this conversation, issue CPI-C calls on other conversations, or continue with other processing.

The description of each CPI-C call includes information about the conversation states in which it can be issued. For a table of which verbs can be issued in each conversation state, see Conversation State Changes.

1.4.1 The Program's View of the Conversation

It is the conversation rather than the program that is in a particular state. A program can be conducting several conversations, each of which is in a different state. If a conversation is said to be in Send state, this is from the viewpoint of the local program. To the partner program, the conversation is in another state (such as Receive).

1.4.2 State Changes

A change in the conversation state can result from any of the following:

1.4.3 State Checks

A state check occurs when a program issues a CPI-C call, and the conversation is not in the appropriate state. For instance, a state check would occur if a program issued the Send_Data call while the conversation was in Receive state. When a state check occurs, CPI-C does not execute the call; it returns state-check information through the return_code parameter.

Previous Page Contents Page Top of Page Next page