Operating Natural Development Server

This document describes how to operate Natural Development Server in a Windows-based environment.

The following topics are covered:


Introduction

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/.

Starting the Development Server

The development server can be started as follows:

natdvsrv [start-options] [Natural-parameters]

where

-p[ort][=]<port> Mandatory start option. Starts the server on the specified port.
-c[lient][=]<type> Optional start option. Defines the types of clients which are permitted to connect to the server. <type> can be one of the following:
NAT Only Natural for Windows (Natural Studio) clients are permitted to connect to this server.
ONE Only NaturalONE clients are permitted to connect to this server.
ANY 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 ANY as the default. If a client which is not permitted tries to connect to the server, Natural error NAT7742 will be issued, indicating that the current IDE is not permitted.

Note:
If Natural Security is installed, the types of clients permitted to connect to the server can be controlled by setting the Natural Security option Natural client access.

-s[tart][=]<image> 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/.

[Natural-parameters] 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.

Examples

natdvsrv -port=1234

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.

Determining the Screen Size for Web I/O

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:

Variable Name Description
NWO_NCOLUMNS The number of columns to be used. Default: 80.
NWO_NROWS 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.

Example

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.

SET NWO_NROWS=50

When the current screen size is 80x24, the above SET command changes the screen size to 80x50.

Terminating the Development Server

The development server can be terminated as follows:

natdvsrv -t[erminate][=]<port>

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.

Note:
Alternatively, a development server session can be terminated via the kill <process-id> command.

Example

natdvsrv -t1234

terminates the listener and all Natural sessions launched by the listener.

Getting Help

natdvsrv [-h[elp]]

displays the help information on the available options.

NDV Configuration File

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:

  1. 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.

  2. The entry of the terminated server in the configuration file will then be removed.

Trace

A server trace can be established via the built-in trace macros.

Important:
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:

natdvsrv_port

where

port is the assigned port number.

The name of a session trace is constructed as shown below:

natdvsess_ipinfo_ pid_port

where

ipinfo is the client connection's IP address/name.
pid is the process ID of the development server session.
port is the port of the listener process.

Example

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

Note:
Be careful when using the plus sign (+) notation. This could cause a lot of trace files to be generated.

Error Messages

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 PATH environment variable or that it is located inside $NATBIN.
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:

  • Check that the server with the specified port is running.

  • Check that you have the rights to terminate the server.

82 Error accessing file 'NDVSERVER.PRU'. 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.