OSI/TS Configuration and Management Manual

OSI/TS Configuration and Management Manual424831-001
C-1
C
Programming Examples
This appendix contains an example application for transferring unstructured binary files
(for example, object code files). The same file-transfer application is shown in both
TAL and in C. In this example, each program—the requester and the responder—use
file-system calls to access the services of its local OSI/TS transport entity. The transport
entities exchange data and control information (TPDUs) over an OSI network. In this
example, the OSI/TS subsystem manages the connection-establishment response.
Source code files for all the examples contained in this appendix are provided as part of
the OSI/TS software. They reside (by default) in the volume and subvolume
$SYSTEM.ZOSITS.
TAL Example File-Transfer Program, Requester
Before running this program, your OSI/TS subsystem must be configured and running.
Before compiling the source code, you must first replace the file and process names
shown here with names that reflect your environment, as described in the first comment
box in the code.
The source code file for this example is provided as part of the OSI/TS software. It
resides (by default) in $SYSTEM.ZOSITS.EXPRGT1A.
! ******************************************************
! * File: EXPRGT1A
! *
! * TAL file transfer program example: Requester
! *
! 1) Replace "source" with the name of the file you
! want to transfer.
! 2) Replace "destin" with the name you want used to
! generate a file for the transferred copy.
! 3) Make sure that two TSP SUs are configured and
! replace $tsp1.#s00001 and $tsp2.#s00001 with
! the correct names.
! 4) Replace "vol" and "subvol" with the correct names.
! 5) Compile and RUN.
!
! ******************************************************
!
?symbols, inspect
?nocode, nomap, nolmap
?DATAPAGES = 64
?page
! ****************************************************
! * DATA STRUCTURE DECLARATION
! ****************************************************
! 123456789012345678901234
INT .srcex^file^name[0:11] :="source "
INT .dsex^file^name[0:11] :="destin ";
INT .ext^dev^send[0:11] :="$tsp1.#s00001 ";
INT .ext^dev^rcv[0:11] :="$tsp2.#s00001 ";
INT .default^subvol[0:7] :="$vol subvol ";