gtpa2m2yApplication Programming

RPC Servers

RPC servers are subsystem unique.

Note:
Because the TPF 4.1 system does not support dynamic endpoints (port numbers) for RPC servers, the same RPC server cannot run in multiple subsystems unless there is a unique connection for the server.
The local IP address or port number has to be unique to establish a unique connection.

Whenever a remote procedure call takes a system error and the ECB exits, the RPC server is deactivated and cleaned up. The TPF 4.1 system provides the tpf_RPC_options API with a TPF_RPC_OPTIONS_EXIT_THREAD parameter so you can avoid this server deactivation. You can use this parameter to make the issuing thread ECB exit without stopping its process. The TPF_RPC_OPTIONS_EXIT_THREAD parameter must be issued in the call thread immediately before the requested RPC interface function is run. The tpf_RPC_options API provides a corresponding reset parameter, TPF_RPC_OPTIONS_EXIT_PROCESS, that must be issued before the remote procedure call returns.

Starting and Stopping RPC Servers

You can start or stop RPC servers through the following:

INETD

You can add, change, start, or stop RPC servers by using the following commands for the INETD:

See TPF Operations for more information about the ZINET ADD, ZINET ALTER, ZINET START, and ZINET STOP commands.

TPF Cycle-Up and Cycle-Down Processing

RPC servers can be started and stopped automatically in cycle-up and cycle-down processing. This support is implemented through the INETD.

Note:
Transmission Control Protocol/Internet Protocol (TCP/IP) and socket support deactivates connections as part of cycle-down processing. Any or all of the outstanding RPC requests may or may not be processed during cycle-down processing. RPC takes a communication error cycling to 1052 state; however, RPC will end normally when cycling down to CRAS state (if the INETD is not set to be active in CRAS state). See the ZINET commands in TPF Operations for more information.

E-Type Loader

RPC servers are automatically recycled whenever any loadset is activated, deactivated, or excluded by the E-type loader. Continuous service is provided between the time that the server is shut down and the server is reactivated. Any remote procedure calls received during this time are queued and handled by the newly activated server. All remote procedure calls in the TPF 4.1 system cause an ECB to be created that inherits the system activation number. Newly activated functions will not be used by the RPC server until the server is restarted and can create ECBs with the new system activation number.

The tpf_is_RPCServer_auto_restarted API is provided so you can have a server application query if it is automatically restarted. Applications can skip certain initial startup code for a server that is restarted.