OSI/AS Programming Manual

Example 1: Session Layer
Sample Programs
E–16 056783 Tandem Computers Incorporated
-- large enough to retrieve all of the data sent.
-- A real application would normally check the more^data
-- parameter and repeat the call using the current value
-- of the next^pos parameter as the value of the start^pos
-- parameter for the next call until all of the data was
-- retrieved.
--
CALL retrieve_user_data( cepi_2 );
--
-- APPLICATION 1
-- Issue release request.
--
print_aps( "APPL1: release request" );
status := APS_ASSOC_RELEASEREQ_( cepi_1
, user_data_1
);
IF ( status <> ZAPS^VAL^STATUS^OK ) THEN
CALL display_aps_status( cepi_1, error_releasereq_proc );
--
-- APPLICATION 2
-- Wait for release indication.
--
CALL wait_for_event( cepi_2, ZAPS^VAL^EVT^RELEASE^IND );
--
-- Get release indication user data.
--
CALL retrieve_user_data( cepi_2 );
--
-- Issue release response.
--
release_result := ZAPS^VAL^RLS^ACCEPT;
print_aps( "APPL2: release response" );
status := APS_ASSOC_RELEASERSP_( cepi_2
, release_result
, user_data_2
);
IF ( status <> ZAPS^VAL^STATUS^OK ) THEN
CALL display_aps_status( cepi_2, error_releasersp_proc );
--
-- APPLICATION 1
-- Wait for release confirm.
--
CALL wait_for_event( cepi_1, ZAPS^VAL^EVT^RELEASE^CNF );
--
-- Get parameters of the release confirm.
--
error :=
APS_ASSOC_GETPARAM_( cepi_1
, ! conid !
, ! local-appl !