This section describes how to terminate a Natural RPC server. Several methods exist.
Use the TE
(Terminate
Server) command of the SYSRPC
utility as
described in Terminating
a Server in the SYSRPC
Utility documentation.
A Natural RPC server can only be terminated if the server is currently
neither executing a remote CALLNAT
nor waiting for the next
CALLNAT
request in a conversation.
Use the
button in the Server subtree of the EntireX System Management Hub.The Application Programming Interface (API)
USR2073N
enables you to ping or terminate a Natural RPC
server.
The interface sends a ping or terminate command to an RPC server specified by node name and server name. The returned message contains the following information:
the version of the running server (PING
) or
the acknowledgment of termination (TERMINATE
) or
an error message.
To make use of USR2073N
Copy the subprogram USR2073N
from libray
SYSEXT
to the library SYSTEM
or to the steplib
library or to any application in the server environment.
Using a DEFINE
DATA
statement in structured mode or a RESET
statement in reporting mode, specify the following parameters:
Parameter | Format | I/O | Description | |
---|---|---|---|---|
FUNCTION |
A10 | I | PING |
Asks the RPC server for its version. |
TERMINATE |
Initiates the finishing of the Natural RPC server task. | |||
SRVNODE |
A192 | I | Specify the node name or * if
the server name represents a Location Transparency of EntireX or a logical
broker node name as
LOGBROKER=nodename ). See the
keyword
subparameter SRVNODE
of profile parameter RPC or
parameter macro
NTRPC .
|
|
SRVNAME |
A192 | I | Server name or EntireX Location
Transparency. See the
keyword subparameter
SRVNAME
of profile parameter RPC or
parameter macro
NTRPC .
|
|
LOGON |
A1 | I |
The logon flag |
|
USER-ID |
A8 | I |
If If the client does not run under Natural Security (NSC) and the
logon flag is set, the user ID and password have to be specified unless the
data have been entered via Application Programming Interface
|
|
PASSWORD |
||||
MSG |
A79 | O | Message returned. | |
RC |
I2 | O | Response code; possible values are: | |
0 |
MSG contains a normal message from RPC
server or Broker.
|
|||
1 |
MSG contains an error message from RPC
server or Broker.
|
|||
2 |
MSG contains an error message from the
interface.
|
|||
3 |
Natural Security error. |
Before invoking the API, fill the input variables listed above.
This exit is called after the Natural RPC server has deregistered and logged off from the server node.
If no NATRPC99
program is found, the server terminates
immediately as usual.
If the program NATRPC99
is found, the server continues to
run as a normal Natural session.
NATRPC99
is called with a FETCH
statement without any
parameters, that is, no data is put on the Natural stack before
NATRPC99
has been called.
You may add any coding to NATRPC99
, including transfer
control statements (FETCH
,
CALLNAT
,
PERFORM
) and
statements that terminate the program (STOP
,
ESCAPE
,
TERMINATE
).
If NATRPC99
is terminated with a RETURN
or
STOP
statement, Natural returns to the NEXT
prompt.
If the NEXT
prompt is not supported in the environment used
(profile paramter CM
=OFF
, asynchronous
Natural session, etc.) the session terminates. Otherwise, the session tries to
read the next command from the primary input file/dataset for Natural commands
and INPUT
data (CMSYNIN
).
NATRPC99
must be a Natural program.
NATRPC99
must be located in the library
SYSTEM
on system file FUSER
. The steplib
concatenation of the library to which the server currently is logged on is not
evaluated to find NATRPC99
.
NATRPC99
is currently only called if the server is
terminated with a TE
(Terminate Server) command issued using
the SYSRPC
utility as described in Terminating
a Server in the SYSRPC
Utility documentation. The exit is not called if the server is
terminated via the EntireX
System Management Hub.
Natural objects that are called by NATRPC99
(FETCH
,
CALLNAT
,
PERFORM
) must be
located either in the library to which the server is logged on or in one of its
steplibs (including SYSTEM
on system file FUSER
).
The keyword subparameter SRVTERM
of profile parameter RPC
or
parameter macro
NTRPC
influences the termination behavior of a Natural RPC server. By
default, a server is never terminated (SRVTERM=NEVER
) unless one
of the termination methods described before is applied.
If you use an Attach Manager to dynamically start Natural RPC servers on
request, you should set SRVTERM
to TIMEOUT
.
With this parameter setting, a Natural RPC server is automatically terminated
if the wait time for the next client request outside of an RPC conversation is
exceeded.