Set_Error_Direction

The Set_Error_Direction call (function name cmsed) specifies whether a program detected an error while receiving data or while preparing to send data.

CM_ENTRY Set_Error_Direction(
  unsigned char FAR *conversation_ID,  
  CM_INT32 FAR *error_direction,       
  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.
error_direction
Supplied parameter. Specifies the direction in which data was flowing when the program encountered an error. Possible values are:
CM_RECEIVE_ERROR
An error occurred in the data received from the partner program.
CM_SEND_ERROR
An error occurred while the local program prepared to send data to the partner program.
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 error_direction 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.

Remarks

This call overrides the default error direction established by Initialize_Conversation or Accept_Conversation. The default error direction is CM_RECEIVE_ERROR.

Error direction is relevant only when a program issues Send_Error in SEND_PENDING state, immediately after issuing Receive and receiving data (data_received is a value other than CM_NO_DATA_RECEIVED) and a send indicator (status_received is CM_SEND_RECEIVED).

When the conversation is in SEND_PENDING state, the program issues Send_Error if it detects errors in the received data or if an error occurred while the local program prepared to send data. The program must supply the error direction information using Set_Error_Direction before issuing Send_Error because the LU cannot tell which kind of error occurred (receive or send). The new error direction remains in effect until a subsequent Set_Error_Direction changes it.

When Send_Error is issued, the partner program receives one of the following return codes: