This document describes how to operate Natural Development Server in a Windows-based environment.
The following topics are covered:
Natural Development Server for Windows represents a listener process which waits for incoming Natural clients to connect. For every connection request, the listener starts a Natural process which will then communicate with the corresponding client. Natural Development Server can only be run in a valid Natural environment. For the currently applicable version of Natural for Windows, refer to Empower at https://empower.softwareag.com/.
The development server can be started as follows:
natdvsrv [start-options] [Natural-parameters]
||Mandatory start option. Starts the server on the specified port.|
||Optional start option. Defines the types of clients which are permitted to connect to the server. <type> can be one of the following:|
||Only Natural for Windows (Natural Studio) clients are permitted to connect to this server.|
||Only NaturalONE clients are permitted to connect to this server.|
||Both Natural for Windows (Natural Studio) and NaturalONE clients are permitted to connect to this server.|
|If this start option is not
specified, the server will use
|| Optional start option. The Natural
image to be used as the server session. Any valid Natural image can be used. If
this start option is not specified, the server will use
"natural" as the default session image.
For the currently applicable version of Natural for Windows, refer to Empower at https://empower.softwareag.com/.
||Optional. The Natural parameters to be used in conjunction with the session image. The syntax is identical to starting a Natural session with Natural parameters.|
starts the listener on port 1234, (implicitly) uses the image "natural" as the server session, and (implicitly) permits all types of clients to connect to the server.
natdvsrv -p=1234 -c=ONE
starts the listener on port 1234, (implicitly) uses the image "natural" as the server session, and permits only NaturalONE to connect to the server.
natdvsrv -p1234 -cNAT parm=myparm stack=(LOGON mylib)
starts the listener on port 1234, (implicitly) uses the image "natural" as the server session, and permits only Natural for Windows (Natural Studio) to connect to the server. When a client session connects, the listener starts Natural with the parameter module "myparm" and applies a logon to "mylib".
natdvsrv -p=1234 -s=naturalsql
starts the listener on port 1234, uses the image "naturalsql" as the server session, and (implicitly) permits all types of clients to connect to the server.
By default, a screen size of 80x24 is used for web I/O with the Natural Web I/O Interface. This is determined by the following variables:
||The number of columns to be used. Default: 80.|
||The number of rows to be used. Default: 24.|
If a different screen size is to be used, you have to set these variables before starting the development server.
Define the above variables as system variables in the
Environment Variables dialog box. Or execute the
SET command (for example, using the
Command Prompt window), using the above variables.
When the current screen size is 80x24, the above
SET command changes the screen size to
The development server can be terminated as follows:
where <port> is the port number of the development server to be terminated.
Terminating the server will also terminate all Natural sessions started by the server.
Alternatively, a development server session can be terminated via the
terminates the listener and all Natural sessions launched by the listener.
displays the help information on the available options.
When a new development server is started, the file NDVSERVER.PRU located in your installation directory, in the subdirectory Natural\Prof, will be accessed to add information about the server.
When a server is terminated, the following steps are performed:
A search of the specified port takes place in order to find the server's process ID. This process ID is then used to terminate the server.
The entry of the terminated server in the configuration file will then be removed.
A server trace can be established via the built-in trace macros.
In order to generate trace files for the listener and all started sessions, a plus sign (+) must be used as the trace file name. Otherwise, a new development server session will overwrite an existing trace file.
The name of the listener trace file is constructed as shown below:
||is the assigned port number.|
The name of a session trace is constructed as shown below:
||is the client connection's IP address/name.|
||is the process ID of the development server session.|
||is the port of the listener process.|
setenv NCTR_STATE 1 setenv NCTR_CONFIG path/nctr.cfg setenv NCTR_OUTPUT /tmp/+
After a listener process was started on port 4712 and two clients have connected, the following trace files are generated into the directory /tmp:
natdvsrv_4712 natdvsess_pc1_1055_4712 natdvsess_pc2_1045_4712
Be careful when using the plus sign (+) notation. This could cause a lot of trace files to be generated.
When a development server is started or terminated, the following error messages can occur:
|Error Number||Error Message||Action|
|66||The port number is missing.||Provide a valid port number.|
|67||The specified port number is already in use.||Use a port which is not yet occupied on the machine.|
|68||Invalid syntax [%syntax%] encountered.||The options used to start or terminate the server are used wrongly according to [%syntax%].|
|70||Invalid port number encountered.||Use a correct port number inside the valid range of 0 - 9999 and do not use other characters or digits.|
|71||Listen on specified port failed.||Try again with a different port number.|
|78||The specified server session [%session-name%] is not accessible.||Check that the specified session can be found via the
|79||The port number [%number%] exceeds upper limit (99999).||Use a port inside the valid range.|
|80||Invalid combination of options [%options%] encountered.||Check that the specified options can be used together.|
|81||NDV server could not be terminated (Reason: %reason%).||
Check the reason:
|82||Error accessing file
||Check that the file is available in your installation directory, in the subdirectory Natural\Prof, and that it has a valid content. If the file is corrupted, delete the file.|