The Confirmed call (function name cmcfmd) replies to a confirmation request from the partner program. It informs the partner program that the local program has not detected an error in the received data. Because the program issuing the confirmation request waits for a confirmation, Confirmed synchronizes the processing of the two programs.
CM_ENTRY Confirmed(
unsigned char FAR *conversation_ID,
CM_INT32 FAR *return_code
);
The conversation must be in one of the following states when the program issues Confirmed:
CONFIRM
CONFIRM_SEND
CONFIRM_DEALLOCATE
The new state is determined by the old state—the state of the conversation when the local program issued Confirmed. The old state is indicated by the status_received value of the preceding Receive call. The following table summarizes the possible state changes when return_code is set to cm_ok.
Old state | New state |
---|---|
CONFIRM | RECEIVE |
CONFIRM_SEND | SEND |
CONFIRM_DEALLOCATE | RESET |
Other return codes result in no state change.
A confirmation request is issued by one of the following calls in the partner program:
The send type is set to CM_SEND_AND_CONFIRM.
The send type is set to CM_SEND_AND_PREPARE_TO_RECEIVE and the prepare-to-receive type is set to CM_PREPARE_TO_RECEIVE_CONFIRM.
The send type is set to CM_SEND_AND_PREPARE_TO_RECEIVE, the prepare-to-receive type is set to CM_PREPARE_TO_RECEIVE_SYNC_LEVEL, and the synchronization level is set to CM_CONFIRM.
The send type is set to CM_SEND_AND_DEALLOCATE and the deallocate type is set to CM_DEALLOCATE_CONFIRM.
The send type is set to CM_SEND_AND_DEALLOCATE, the deallocate type is set to CM_DEALLOCATE_SYNC_LEVEL, and the synchronization level is set to CM_CONFIRM.
A confirmation request is received by the local program through the status_received parameter of Receive. The local program can issue Confirmed only if the status_received parameter is set to one of the following values:
CM_CONFIRM_RECEIVED
CM_CONFIRM_SEND_RECEIVED
CM_CONFIRM_DEALLOC_RECEIVED