Description:
Terminates an existing conversation with a partner program on another machine.
Declaration:
subroutine APPCEnd( integer:CONVERSATION_ID,
integer:SYNC_LEVEL )
library "eslappc"
Arguments:
•CONVERSATION_ID is an integer variable containing the conversation identifier (handle) for the APPC conversation returned by either APPCStart or APPCAcceptStart.
•SYNC_LEVEL is an integer variable used to coordinate ending a conversation with the partner. Valid constants are:
APPC_Abend |
Abnormal termination. If your program was sending data, this constant forces the data in the buffer to be sent prior to deallocating the conversation. |
APPC_Flush |
(Default) Forces the data to be sent before ending the conversation. |
APPC_Confirm |
Requests confirmation and deallocates the conversation following receipt of an APPC_Confirmed event notification. The conversation is NOT deallocated if |
|
an APPC_ReceiveError or APPC_SendError event notification is received. |
APPC_SyncLevel |
This defaults to APPC_Confirm if the conversation synchronization level is APPC_Confirm, or to APPC_Flush if the conversation synchronization level is APPC_None. The conversation synchronization level is specified as an argument on the APPCStart subroutine call. |
Errors:
APPC_NORMAL_COMPLETION |
Normal completion. |
APPC_ERR_OUT_OF_MEMORY |
Out of memory. |
APPC_ERR_INV_CONV_ID |
Invalid argument: CONVERSATION_ID |
APPC_ERR_INV_SYNC_LEVEL |
Invalid argument: SYNC_LEVEL |
APPC_ERR_UNEXPECTED_ERROR |
Unexpected error encountered. |
Example:
response to stimulus APPC_EVENT APPC_Ended ConvID
call APPCEnd ( ConvID, # Handle from Start/AcceptStart
Sync ) # Use the conversation sync
copy 0 to ConvID # Terminate
# My program is ending
response to MainWindow on close
if (ConvID != 0) then
call APPCEnd ( ConvID, # Handle from Start/AcceptStart
Sync )
end if