gtpa2m2qApplication Programming

Starting a TPF Application from the Internet

Assuming that a Hypertext Transfer Protocol (HTTP) server is installed, TPF Internet server support provides a way to start an E-type program based on an application name as described in the HTTP request. So, it appears that starting an application is similar to the way it is implemented on a UNIX system while, in reality, the program is started using the TPF system loader.

On another system, write an executable script, which is a type of executable file, and transfer it to the TPF system using the TFTP server. The TFTP server has the capability to convert the data to EBCDIC if necessary.

When the HTTP server processes the executable script, it creates a child process that is associated with an E-type program in the TPF application using the tpf_fork function. The HTTP server must have execute access permission to the executable script.

A TPF application can direct its output to the Internet using file system APIs on file descriptors that refer to sockets.

Executable Script

An executable script is a type of executable file that can be used by the tpf_fork function to start a TPF application.

The content of an executable script is EBCDIC text of the form:

#!interpreter name

The interpreter name is the 4-character loader segment (E-type program) name containing a main function.

Example

Using the example of asking for the availability of an airline flight, assume the first program in the availability application is QZZ2. The associated executable scripts would contain:

#!QZZ2

For this example, when the client on the Internet requests availability, the Internet daemon starts the HTTP server, which creates the child process that runs E-type program QZZ2.