Set_Receive_Type

The Set_Receive_Type call (function name cmsrt) specifies how the program will receive data on subsequent Receive calls. It overrides the default receive type established by the Initialize_Conversation or Accept_Conversation call. By default, the program waits for data to arrive if it is not available when the Receive call is issued.

The receive type value affects all subsequent Receive calls. It can be changed by reissuing Set_Receive_Type.

CM_ENTRY Set_Receive_Type(
  unsigned char FAR *conversation_ID,  
  CM_INT32 FAR *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.
receive_type
Supplied parameter. Specifies how data is to be received by the program on the subsequent Receive calls. Possible values are:
CM_RECEIVE_AND_WAIT
The local program receives any data that is currently available from the partner program. If no data is currently available, the local program waits for data to arrive.
CM_RECEIVE_IMMEDIATE
The local program receives any data currently available from the partner program. If no data is available, the local program does not wait.
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; the value specified by conversation_ID or receive_type is invalid, or the address of a variable is invalid.
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.