OSI/AS Programming Manual
Example 1: Session Layer
Sample Programs
056783 Tandem Computers Incorporated E–29
retrieve_user_data( cepi_2 );
/* */
/* APPLICATION 1 */
/* Data request */
/* */
printf( "APPL1: data request\n" );
status = APS_DATA_REQ_( cepi_1
, (int *) &user_data_1
);
if ( status != ZAPS_VAL_STATUS_OK )
display_aps_status( cepi_1, error_datareq_proc );
/* */
/* APPLICATION 2 */
/* Wait for data indication. */
/* */
wait_for_event( cepi_2, ZAPS_VAL_EVT_DATA_IND );
/* */
/* Get the data. */
/* This program assumes that its user_data structure is */
/* 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. */
/* */
retrieve_user_data( cepi_2 );
/* */
/* APPLICATION 1 */
/* Issue release request */
/* */
printf( "APPL1: release request\n" );
status = APS_ASSOC_RELEASEREQ_( cepi_1
, (int *) &user_data_1
);
if ( status != ZAPS_VAL_STATUS_OK )
display_aps_status( cepi_1, error_releasereq_proc );
/* */
/* APPLICATION 2 */
/* Wait for release indication */
/* */
wait_for_event( cepi_2, ZAPS_VAL_EVT_RELEASE_IND );
/* */
/* Get release indication user data. */
/* */
retrieve_user_data( cepi_2 );
/* */
/* Issue release response */
/* */