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
);
The conversation can be in any state except RESET.
There is no state change.
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: