The Windows RPC Server, together with the C Wrapper, enables you to call DLLs as servers.
This document covers the following topics:
See also Administering the EntireX RPC Servers using System Management Hub.
The library and program names that come from the client are used to locate the target server. This two-level concept (library and program) has to be mapped in some way to the RPC Server environment. The target servers and their stubs are implemented as Windows DLLs. Windows DLLs also have a two-level concept. The library and program names that come from the client are mapped as follows:
The library name is used to form the file names of the target server DLL and stub DLL.
The program name is used to form the entry point names for the target server DLL and stub DLL.
The stub DLL as well as the target server DLL must be accessible through the standard Windows DLL load mechanism.
To locate the target server, the Possible Values for Libraries is also
used as a kind of search sequence. The default for the library parameter is set
PREFIX(D) - PREFIX() to be compatible with server stubs and target servers
written according to C Wrapper.
Under normal circumstances it is not necessary to change the library parameter. There may, nevertheless, be occasion to do so:
Changing the platform default of the library parameter gives you control and independence over the library name that comes from the client.
By changing it to a setting of
FIX(DMYLIB) - FIX(MYLIB) and renaming
the server stub and target server built according to
EntireX C Wrapper to
DMYLIB and MYLIB, you can tailor all
or part of the target servers to these libraries regardless of what the client
Changing the platform default can also make sense when Natural is the client environment, since it always sends SYSTEM as the library name.
Assume the following situations:
A client sends Example as the library name and CALC as the program name.
A stub DLL with DExample.dll built with the delivered makefile Server.mak or a corresponding one exists and can be accessed through the standard Windows DLL load mechanism.
A target server DLL with the name Example.dll built with the delivered makefile Server.mak or a corresponding one exists and can be accessed through the standard Windows DLL load mechanism.
The default value for Windows of
PREFIX(D) - PREFIX() for the
library parameter is not changed.
The RPC Server under Windows searches for a stub DLL with:
An entry point derived from the program name that comes from the client by adding a prefix D. For our example the entry point is DCALC. This prefix has nothing to do with any library parameter configuration and is always D.
Names formed by the instructions of the library parameter from left
to right. The first library parameter
take the library name that comes from the client and add the prefix. For our
example above, the DLL name is
If in step 1 such a DLL can be located through the normal DLL load mechanism, it is taken as the stub; otherwise the next DLL name is formed using the next library parameter entry (step 2). If all library parameter entries have been worked off and the stub is not located, an error is returned to the client.
For our example above, the stub DExample.dll is found with the first library parameter entry.
The RPC Server under Windows searches for the target server DLL with:
An entry point using the program name that comes from the client request directly. For our example above, the entry point is CALC.
Names formed by the instructions of the library parameter from left
to right. The first library parameter
PREFIX(D) means: take the library that
comes from the client and add the prefix. For our example above, the DLL
name is DExample.dll.
If in step 1 such a DLL can be located through the normal Windows DLL load mechanism, it is taken as the target server; otherwise the next DLL name is formed using the next library parameter entry (step 2). If all library parameter entries have been worked off and the target server is not located, an error is returned to the client.
For our example above, the target server Example.dll is found with the second library parameter entry.
This section covers the following topics:
Comments must be on a separate line.
Comment lines can begin with '*', '/' and ';'.
Empty lines are ignored.
Headings in square brackets [topic] are ignored.
Keywords are not case-sensitive.
|Configuration File Parameter Syntax (UNIX, Windows, IBM i)||Value||Req.
||string||R||Broker ID used by the server.||Corresponds to the
||case-sensitive, up to 32 characters||R||Server class used by the server.||Corresponds to the
||O||This field exposes the Broker ACI field
||See Using Internationalization.|
||0-9 or Y | N||O||Enforce compression when data is transferred between broker and server.||See Data Compression in EntireX Broker.|
||0 | 1 | 2||O||Enforce encryption when data is transferred between client and server.||Corresponds to the
||n||O||Determines the Broker API to use.||Corresponds to the
||YES | NO||O||
||case-sensitive, up to 32 characters||R||Server Name used by the server.||Corresponds to the
||case-sensitive, up to 32 characters||R||Service used by the server.||Corresponds to the
||any digit within range 0 to 99999||O||If greater than zero, starts the RPC server with a separate SMH communication task and listen port <smhport> to the local TCP/IP system.|
||O||Set the SSL parameters.||See Using SSL or TLS with the RPC Server.|
||n||O||Timeout in seconds, used by the server to wait for Broker requests.||Corresponds to the
||case-sensitive, up to 32 characters||R||Used to identify the server to the broker.||Corresponds to the
||case-sensitive, up to 32 characters||O||Password for Broker logon.||Corresponds to the
||See Possible Values for Endworkers||O||Defines the behavior of worker tasks on completion of client requests.||See Scalability of the RPC Server.|
||n||O||Minimum number of parallel worker threads started.|
||n||O||Maximum number of parallel worker threads started.|
||None | Standard | Advanced | Support||O||Select the trace level for this server.||See Activating Tracing for the RPC Server.|
||O||The name of the destination file for trace output.|
||None | STUBLOG | NOTRUNC||O||Additional trace option if trace is active.
||O||Specifies criteria to locate target servers and any stubs.||See Possible Values for Libraries and Locating and Calling the Target Server.|
||n||O||Number of restart cycles the RPC Server will try to connect to the Broker. A restart cycle will be repeated every <timeout> +60 seconds. When the number of cycles is reached and a connection to the Broker is not possible, the RPC Server stops.||This may occur when the RPC Server is started prior to the Broker or when the Broker is shut down before the RPC Server is shut down.|
The server is able to adjust the number of worker threads to the current number of client requests. This is configured with the parameter endworkers and several others. See Scalability of the RPC Server for information on how the various parameters work together and what combinations can be specified.
NeverThe number of worker threads is fixed. No additional worker threads are started. Minworkers determines the number of workers started.
Timeout is usedThe number of worker threads ranges between the
The server stops all worker threads not used in the time specified by
ImmediatelyThe number of worker threads ranges between the
The server stops a thread immediately as soon as it has finished its
conversation. When the number of active workers falls below the number of
workers specified in
The library parameter defines how the RPC Server locates the target server and any stubs on the platform.
The following coding rules apply to the library parameter:
Up to five library entries can be specified as a sequence.
Library entries are separated by a hyphen "-".
Library entries are used from left to right by the RPC Server.
The meaningful combinations vary per platform and the type of target server:
|Operating System||Type of Target Server||Configuration||Description|
|IBM i||Target servers in ILE COBOL compatible with
Mapping IDL Data Types to COBOL Data Types in the COBOL Wrapper documentation
Target servers ILE RPG compatible with Using EntireX RPC for RPG under IBM i
Target servers ILE CL compatible with Software AG IDL to CL Mapping.
||The library sent with the client request is ignored. The configured
|Target servers and their stubs compatible with EntireX C Wrapper.||
||The library name sent with the client request is ignored. The program name sent with the client request is used to locate the target server.|
|The library sent with the client request is ignored. The configured
||The library name sent with the client request is used to locate the target server and any stubs on the platform.|
|The library name sent with the client request is prefixed with the
value in "
library = PREFIX(D) - PREFIX()
The default for the
library parameter is set to satisfy the environment
specifics best. Under normal circumstances it is not necessary to change the
For an explanation of the approach to locating the target server on your platform, see Locating and Calling the Target Server.
The RPC server can be configured to adjust the number of worker threads to the current number of client requests. When more clients are active, more worker threads are needed to achieve the best throughput. Depending on the configuration, worker threads are started on demand and stopped as soon as they are no longer needed.
This mechanism can be configured with the following parameters:
|EntireX RPC Server under operating system:||Configuration||endworkers||minworkers||maxworkers||timeout|
|Fixed number of workers.||Never.||Determines the number of workers started.||Unused.||Not used with this configuration.|
|Scaling number of workers between
||Immediately.||Determines the minimum number of workers started.||The upper limit of workers started.||Not used with this configuration.|
|Scaling number of workers between
||Timeout.||The idle time for workers can be configured, i.e. a worker is stopped when, for the period defined by timeout, no client request has to be served and the minimum number of workers has not been reached.|
The endworkers parameter determines the condition under which a worker
will be stopped. The value is the period of time specified by the parameter
timeout (600 seconds, i.e. 10 minutes). Active workers will be stopped if no
client requests arrive within the timeout period, except for the number of
threads specified in
Minworkers specifies the minimum number of workers that must be available
to handle incoming client requests. The server is started (manually) and the
first worker (
minworkers=1) waits for client requests. When the first client
request arrives, a second worker is started. This ensures that there will be at
least one free worker (
minworkers=1) to handle the next incoming client
When the first client request has been worked off (in conversational mode when the conversation has been ended, and in non-conversational mode when the request has been answered), there will be two workers active. For the next incoming client request (second request) no additional worker will be started because the second worker is still free. A third worker will only be started if a third client request arrives before the second request has been finished, in which case there will be three active workers, and so on.
maxworkers parameter specifies the maximum number of active worker
tasks permitted (default is 10).
In this example the
endworkers parameter has been set to "
This setting will stop worker threads immediately when client requests are
completed, except for the number of threads specified in minworkers. All other
behavior is the same as for Configuration 1: Medium Lifespan of Worker Threads.
This configuration determines a fixed number of workers. The
parameter is ignored and the
endworkers parameter is set to "
All worker threads are started immediately with the server and
will never stop. This method is useful in minimizing system resources.
When you first start using Micro Focus RPC Server, we suggest the following settings for scaling the server:
timeout parameter can be set, for example, to 2 minutes (
low value for
minworkers is suggested (e.g.
maxworkers setting depends on the expected maximum number of clients active in parallel (e.g.
It is assumed that you have read the document Internationalization with EntireX and are familiar with the various internationalization approaches described there.
The RPC Server running under Windows
does not, by default, send a codepage as part of the locale string to the broker
assumes that the broker's locale string defaults match; see Broker's Locale String Defaults. If they do not match, provide the codepage explicitly.
When setting the codepage manually with the parameter
the following rules apply:
You can provide a codepage in the locale string sent to the broker. If a codepage is provided, it must follow the rules described under Locale String Mapping.
The RPC server itself does not convert your application data (contained in RPC IDL type A, K, AV and KV fields) received from the broker before giving them to your server application. Under normal circumstances, it is not possible to configure a codepage other than the codepage used in your environment for file and terminal IO. If this is not adhered to, unpredictable results may occur.
The codepage used must also be a codepage supported by the broker, depending on the internationalization approach.
Before starting the RPC Server, set the locale string with the parameter
There are two ways of specifying SSL or TLS, depending on the complexity of the parameters:
as part of the Broker ID for short parameters, the simplest way
using the SSL file, a text file containing more complex parameters.
For more information, see SSL or TLS and Certificates with EntireX.
The simplest way to specify SSL or TLS parameters is to add them to the Broker ID.
For complex SSL or TLS parameters there is the SSL file, a text file containing the parameters.
SSL_FILE keyword points to this text file.
To specify the SSL or TLS parameters in the SSL file
Set the parameters as described under Running Broker with SSL or TLS Transport under z/OS | UNIX | Windows.
Prefix/suffix the Broker ID with the SSL key.
brokerid=SSL://ETB001 . . ssl_file=C:\mySSLdirectory\mySSLParms.txt
Before starting the EntireX RPC server, ensure that all dynamically loaded objects (server stubs and server) can be accessed using the search path.
To start the EntireX RPC server manually
Use the format
RPCserver CFG=<name> [-option] [Brokerid] [Class] [ServerName] [Service]
where <name> determines the configuration file in use.
Sets the RPC server parameter smhport to number. Typically used by SMH Facility.
Defines an alternative log file for Window services. Typically used by Windows Services. See Running an EntireX RPC Server as a Windows Service.
-s[ilent]: Run server in silent mode, that is: no terminal input will be required (e.g. acknowledge error messages). The job will terminate automatically. Recommended for background jobs.
Set the trace destination parameter.
-TraceLevel None.Standard.Advanced. Set the trace level parameter.
The server input arguments will be resolved from left to right. Thus parameters that can be applied on the command line as well in the configuration file may be overriden.
To start the EntireX RPC server using Windows services
For reasons of compatibility with versions before 5.1.1, the old command to start the server
RPCserver <Brokerid> <Class> <ServerName> <Service>
will continue to be supported. However, a server started with this call
will use the default parameters. Parameters other than
Service require the
CFG= form of the server start command.
To start the EntireX RPC server using System Mangagement Hub
See Administering the EntireX RPC Servers using System Management Hub under UNIX | Windows for information on adding an EntireX RPC server to the System Management Hub.
The System Management Hub facility "Adding a Local RPC Server" will use the batch script startcserver.bat of the EntireX Installation to apply the server parameters. Change the batch script according to your system installation or add parameters to the System Management Hub "Start Command" input property.
To stop the EntireX RPC Server
Use the function Deregister a Service or Deregister a Server of the System Management Hub. This method ensures that the deregistration from the Broker is correct.
See also EntireX RPC Server Return Codes.
To switch on tracing for the RPC Server
Set the parameters
Table of Server Parameters.
To evaluate the return codes, see Error Messages and Codes.
See also Tracing the RPC Server.