Synchronizing Processing
You may want your program to ensure that its partner has successfully processed all of the records sent to it before more are sent or before continuing processing. This is known as synchronizing the conversation. Data transmission establishes a useful synchronization point for the conversation; after data is sent, your program should do nothing more until the partner either confirms that it has completed the work without error or sends an error indication.
An APPC program (ESL or non-ESL) declares when it starts a conversation whether it supports and/or requests confirmation processing. Both partners must agree that this is an expected part of their protocol.
Your ESL APPC program can request confirmation of a send either when sending the last data item or else on a separate call that explicitly requests confirmation. If the partner replies positively, an APPC_Confirmed event notification is signalled in your program. If the partner replies with an error, an APPC_ReceiveError event notification is signalled. Your program must contain response definitions for these events.
The partner program can also request confirmation. Its request generates an APPC_ConfirmRequest event notification in your program. Your program must include a response definition for this event, and should respond to the event by either sending a confirmation back to the partner or by signalling an error. If your program ignores a confirmation request from its partner, the conversation is, in effect, suspended, because the partner program will continue to wait for one of these responses.
Note: When data and a request for confirmation arrive simultaneously, the APPC_Data event will be signalled in your program before the APPC_ConfirmRequest event.
How to Use Confirmation Processing
In detail, here is how to use ESL APPC confirmation processing: Confirmation Processing
1.Specify APPC_Confirm as the value for the SYNC_LEVEL argument on the APPCStart subroutine call.
2.Request a send confirmation from your partner by either of the following:
•Specifying APPC_Confirm or APPC_SyncLevel as the value for the SEND_IND argument in the APPCSendString or APPCSendDLLData subroutine call.
•Calling the APPCRequestConfirm subroutine. In the automatic interface, this call should immediately follow the last request that is to be confirmed.
3.Provide three response definitions in your program to trap the possible responses to the request for confirmation:
•response to stimulus ... APPC_Confirmed
•response to stimulus ... APPC_ReceiveError
•response to stimulus ... APPC_SendError
4.To respond to a confirmation request from your partner, provide a response to stimulus ... APPC_ConfirmRequest response definition that calls either the APPCSendConfirmed subroutine or the APPCSendError subroutine.
Subroutines for Confirmation Processing
call APPCRequestConfirm ( CONVERSATION_ID )
call APPCSendConfirmed ( CONVERSATION_ID )
call APPCSendError ( CONVERSATION_ID,
ERROR_ORIGIN )