Set_Prepare_To_Receive_Type

The Set_Prepare_To_Receive_Type call (function name cmsptr) specifies how the subsequent Prepare_To_Receive calls will be executed. It overrides the default prepare-to-receive processing established by Initialize_Conversation or Accept_Conversation. By default, the prepare-to-receive processing is based on the synchronization level of the conversation.

The prepare-to-receive type affects all subsequent Prepare_To_Receive calls. It can be changed by reissuing Set_Prepare_To_Receive_Type.

CM_ENTRY Set_Prepare_To_Receive_Type(
  unsigned char FAR *conversation_ID,  
  CM_INT32 FAR *prepare_to_receive_type,  
  CM_INT32 FAR *return_code            
);
 

Parameters

conversation_ID
Supplied parameter. Specifies the identifier for the conversation. The value of this parameter was returned by Initialize_Conversation or Accept_Conversation.
prepare_to_receive_type
Supplied parameter. Specifies how subsequent Prepare_To_Receive calls will be executed. Possible values are:
CM_PREP_TO_RECEIVE_CONFIRM
Is used to send the partner program the contents of the LU's send buffer and a confirmation request. Upon receipt of confirmation, the conversation changes to RECEIVE state.
CM_PREP_TO_RECEIVE_FLUSH
Is used to send the partner program the contents of the local LU's send buffer and changes the conversation to RECEIVE state.
CM_PREP_TO_RECEIVE_SYNC_LEVEL
Is used by the conversation's synchronization level to determine prepare-to-receive processing. A default synchronization level is established by Initialize_Conversation and can be overridden by Set_Sync_Level.

If the synchronization level of the conversation is CM_NONE, the default, the contents of the local LU's send buffer are sent to the partner program and the conversation changes to RECEIVE state. If the synchronization level of the conversation is CM_CONFIRM, the contents of the local LU's send buffer and a request for confirmation are sent to the partner program. The conversation changes to RECEIVE state when the partner program issues Confirmed, responding to the confirmation request.

return_code
The code returned from this call. The valid return codes are listed below.

Return Codes

cm_ok
Primary return code; the call executed successfully.
cm_program_parameter_check
Primary return code; one of the following occurred:
cm_product_specific_error
Primary return code; a product-specific error occurred and has been logged in the product's error log.

State Changes

The conversation can be in any state except RESET.

There is no state change.