gtpa2m2y | Application Programming |
RPC servers are subsystem unique.
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.
You can start or stop RPC servers through the following:
You can add, change, start, or stop RPC servers by using the following commands for the INETD:
When you enter the ZINET STOP command, the INETD marks the specified server as inactive. The RPC run-time library detects that the ZINET STOP command was issued and attempts an orderly shutdown. The server stops listening on the port and handles all queued or active requests before cleaning up. Two messages are displayed for this condition. INETD processing indicates that the server was stopped (as a direct response to the ZINET STOP command that was entered). The RPC run-time library then displays a message indicating that the server is shut down.
See TPF Operations for more information about the ZINET ADD, ZINET ALTER, ZINET START, and ZINET STOP commands.
RPC servers can be started and stopped automatically in cycle-up and cycle-down processing. This support is implemented through the INETD.
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.