OSI/AS Programming Manual
Example 1: Session Layer
Sample Programs
E–14 056783 Tandem Computers Incorporated
 IF ( error <> ZAPS^ERR^OK ) THEN
 CALL display_aps_error( error_assoc_getparam_proc );
 --
 -- APPLICATION 1
 -- Connect indication
 --
 -- Initialize the user data to a string of the character
 -- "1." Because this is an application using the OSI/AS
 -- Session Layer, we don't set the PCID field of the
 -- user^data structure. This field is used only by
 -- Presentation and ACSE and is ignored by the OSI/AS
 -- Session Layer.
 user_data_1.header.znum^elements := 1;
 user_data_1.element.zlen := $UDBL( num_bytes_to_transfer );
 user_data_1.element.ztype := ZAPS^VAL^DATA^TYPE^VALUE;
 user_data_1.value ':=' [num_bytes_to_transfer * ["1"]];
 --
 -- Wait for connect indication.
 --
 CALL wait_for_event( cepi_1, ZAPS^VAL^EVT^CONNECT^IND );
 --
 -- Get parameters of the connect indication.
 -- Note that the parameter session_rqmnts_1, the service
 -- requirements structure, is set and will be used for
 -- the connect response, thereby accepting the service
 -- requirements set by application 2.
 --
 error :=
 APS_ASSOC_GETPARAM_( cepi_1
 , ! conid !
 , local_appl
 , remote_appl
 , ! connect-result !
 , session_rqmnts_1
 , ! release-result !
 , ! abort-reason !
 );
 IF ( error <> ZAPS^ERR^OK ) THEN
 CALL display_aps_error( error_assoc_getparam_proc );
 --
 -- Get connect indication user data.
 --
 CALL retrieve_user_data( cepi_1 );
 --
 -- Issue connect response.
 --
 connect_result := ZAPS^VAL^CON^ACCEPT;
 print_aps( "APPL1: connect response" );
 status :=
 APS_ASSOC_CONNECTRSP_( cepi_1
 , local_appl_1










