As you may know, it is possible to create your own custom service within VTS (see RPC Manager: Service). As with other VTS services, you have the ability to control the behaviour of your custom service by setting configuration variables. When it comes to services, you have 3 options for setting the variables related to your custom service:
• A service.ini configuration file;
• The application's Config.ini configuration file; or
• A workstation.ini configuration file.
Like a workstation.ini file, service.ini is not a literal name; rather, a service.ini configuration file must be named after the custom service to which it applies, and must be given the extension ".ini". For example, if the custom service is called "SimpleService", then the configuration file would have to be named "SimpleService.ini".
Because the configuration options pertaining to a custom service can be held in one of several configuration files, it is necessary for VTS to determine the correct file from which to obtain the appropriate variable settings.
Note: As of VTS 7.5, the \RPCManager\Register subroutine features two new parameters: ServerList and Sticky. ServerList is an optional parameter that is an array of server names for the service. If used, it overrides any server list configuration that has been done in the .INI files. If not used, the usual method of determining the server list is used (see Config.ini [RPCMANAGER-SERVERS] Section Variables and RPC Manager Configuration).
The configuration file that a service uses is determined when a service instance calls \RPCManager\Register(), according to the following rules:
1. If the "IniFile" parameter to the Register() call is valid, it is interpreted as the name of the configuration file to use; or
2. If the "IniFile" parameter to the Register() call is Invalid, the value of the system level variable RPCExternalConfig is examined, and its value determines the configuration file to use. The value of RPCExternalConfig can be one of:
"0", indicating that application's Config.ini configuration file should be used;
Invalid or "1", indicating the service.ini configuration file (that features the service name followed by the ".ini" extension) should be used; or
"2", indicating that the workstation.ini configuration file on a specific workstation should be used (e.g. the "FREDSPC.INI" workstation.ini configuration file on the workstation named "FREDSPC".)
Once the configuration file to be used has been determined, the section that the services uses within the determined configuration file is also established using a set of rules:
1. If the "Section" parameter to the Register() call is valid, it is suffixed with a hyphen and is used as the root of the section name (for example, "MyService–"); or
2. If the "Section" parameter to the Register() call is Invalid:
a. If the name of the configuration file is a service.ini file (the service name suffixed with ".ini"), a blank root is used for the section name; or
b. If the name of the configuration file is other than a service.ini configuration file (i.e. a Config.ini file or workstation.ini file), the service name is used, suffixed with a hyphen, as the root of the section name (for example, "Sample–").
Suffixing the section name with "Servers" or "Clients" then generates the full section name.
For example, in case 1 above (where the "Section" parameter to the Register() call is valid), the sections would be [MyService-Servers] and [MyService-Clients].
In case 2a (where the service.ini configuration file is used), the sections would simply be [Servers] and [Clients].
In case 2b (where the Config.ini or workstation.ini configuration file is used), the sections would be [Sample-Servers] and [Sample-Clients].
In the event that a section cannot e located in the selected configuration file, VTS searches for the [RPCManager-Servers] or [RPCManager-Clients] sections within the application's Config.ini configuration file.
For information on custom service configuration and related configuration files and variables, please refer to Introduction to Service.ini.