OSI/AS Programming Manual

Example 2: Presentation Layer and ACSE
Sample Programs
056783 Tandem Computers Incorporated E–61
/* */
/* Delete the API context information. */
/* */
printf( "APPL1: discard\n" );
status = APS_DISCARD_( cepi );
if ( status != ZAPS_VAL_STATUS_OK )
display_aps_status( error_discard_proc );
printf( "APPL1: complete\n" );
} /* proc sample_osias_appl_1 (main) */
Server Program The following pages give the source code for the server program (Application 2),
which is configured as APPL2.
TAL Version
? INSPECT, SYMBOLS
? NOCODE, NOMAP, NOLMAP
? PAGE "OSI/AS Sample Program 2 (Application 2)"
--
-- File: EXAPST2B
--
-- OSI/AS Sample Program 2 (Application 2)
--
-- General:
-- This is an example ACSE/Presentation program.
-- It illustrates how to call the APS procedures.
-- Some liberties have been taken in error checking;
-- real applications would include error checking.
-- This program calls the APS procedures in wait mode.
--
-- OSI/AS configuration:
-- 1) The OSI manager process name is $OMGR.
-- 2) ENTRY #APPL.APPL1 is defined (for EXAPST2A).
-- 3) ENTRY #APPL.APPL2 is defined (this program).
-- 4) Either session version 1 or session version 2
-- can be configured.
--
-- To run:
-- 1) Be sure to run this application first. (It will
-- issue an attach and wait for a connect indication.)
-- 2) Run EXAPST2A (APPL1) second.
--
-- This program does the following:
-- 1) Waits for an ACSE associate indication.
-- 2) Issues an ACSE associate response.
-- 3) Waits for a P-DATA indication.
-- 4) Waits for a P-GIVE-TOKENS indication.
-- 5) Issues a P-DATA request.
-- 6) Issues an ACSE release request.
-- 7) Waits for an ACSE release confirm.
--
--
-- Source in ZAPSTAL from the appropriate volume and