Previous Page Contents Page Next Page

1.3 Confirmation Processing

When a program sends data to its partner program, it can also request the partner program to confirm that it has received the data successfully. The receiving program must either confirm receipt of the data or indicate that an error has occurred. The two programs are synchronized each time they exchange a confirmation request and response. This is illustrated in Confirmation Processing.

Confirmation Processing

Invoking Program Invoked Program
Initialize_Conversation
Set_Sync_Level
( sync_level=CM_CONFIRM)
Allocate
Send_Data
Confirm
->
Accept_Conversation
Receive
( data_received=CM_COMPLETE_DATA_RECEIVED)
( status_received=CM_CONFIRM_RECEIVED)
Confirmed
<-
( return_code=CM_OK)
Send_Data
Deallocate
->
Receive
( status_received=CM_CONFIRM_DEALLOC_RECEIVED)
Confirmed
<-
( return_code=CM_OK)

1.3.1 Establishing the Synchronization Level

The synchronization level is one of the conversation's characteristics. There are two possible synchronization levels:

The default synchronization level is CM_NONE ; you can override this using the Set_Sync_Level call.

1.3.2 Sending a Confirmation Request

Issuing the Confirm call does the following:

After issuing the Confirm call, the invoking program waits for confirmation from the invoked program.

1.3.3 Receiving a Confirmation Request

The status_received parameter of the Receive call indicates any future action required by the local program.

In the previous example, the first Received call has a status_received of CM_CONFIRM_RECEIVED, indicating that a confirmation is required before the partner program can continue.

1.3.4 Responding to a Confirmation Request

The invoked program issues the Confirmed call to confirm receipt of data; this frees the invoking program to resume processing.

1.3.5 Deallocating the Conversation

Because the synchronization level of the conversation is set to CM_CONFIRM, the Deallocate call sends a confirmation request with the data flushed from the buffer.

For the second Receive call, status_received is CM_CONFIRM_DEALLOC_RECEIVED, indicating that the partner program requires a confirmation, generated by the Confirmed call, before the conversation can be deallocated.

Previous Page Contents Page Top of Page Next page