HP-UX SNAplus2 CPI-C Programmer's Guide (June 2003)

Concepts
Changing Conversation States
Chapter 148
After the conversation is allocated, the initial state is Send for the
invoking program and Receive for the invoked program.
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:
It flushes the local LU's send buffer.
If the synchronization level is set to CM_CONFIRM, the
Prepare_To_Receive call sends a CM_CONFIRM_SEND indicator to
the partner program through the
status_received
parameter of a
Receive call. This indicator tells the partner program that a
Confirmed response is expected before the partner program can
begin to send data.
Changing to Send State
The conversation state fora 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.