(RPC Manager Library)
Description: This subroutine registers a service for RPC and returns a pointer to the variable containing the current RPC status of the service.
Returns: Pointer containing the current RPC status.
Usage: Script (Subroutine call only)
Format: \RPCManager\Register(ServiceName [, INIFileName, Section, SemObj, StartMode, PrioritySync, ServerList, Sticky])
Parameters: ServiceName { text } { required } { no default: }
The name by which the service is known.
INIFile { text } { optional } { default: see note }
The name of the configuration file (.INI file) from which to get the list of servers and clients for the service. If Invalid, the value of the system level variable RPCExternalConfig (see Setup.ini [SYSTEM] Section Variables) determines the name of the configuration file to use (see also RPC Manager Configuration):
|
Value |
File |
|
0 |
Config.ini |
|
1 |
<ServiceName>.ini |
|
2 |
<WorkstationName>.ini |
Section { text } { optional } { default: see note }
The name of the section in the configuration file from which to get a list of servers and clients for the service. This name is concatenated with the strings "-Servers" and "-Clients" to get the two section names. If Invalid, the section name will be the name of the service concatenated with the two previously mentioned strings. If this section cannot be found, a section called [RPCMANAGER-SERVERS] is searched for, first in the named configuration file, and if still not found, in Config.ini. If no information can be found at all, this workstation is assumed to be the solitary server. The client list section is rarely used, since it does not actually force a socket connection to be established, but simply affects the list of workstation names returned by a call to the GetClientList function.
SemObj { Object } { optional } { default: see note }
An object value for an instance of the system Semaphore module. If Invalid, the RPC Manager will launch an instance of Semaphore for this service.
StartMode { see note } { optional } { no default: }
The mode that the service instance will start up in or become when it loses its connection to the server instance. The mode of a service determines whether or not the RPC Manager transmits service broadcast messages from the server. You should supply the constant \RPC_ACCEPT_ALL (default) if your service requires no synchronization whatsoever; otherwise, set it to \RPC_SYNC_MODE.
PrioritySync { numeric } { optional } { no default: }
When set to non-zero, the PrioritySync flag prevents higher priority servers from syncing with lower priority servers. Most system services do not set this flag.
ServerList { numeric } { optional } { no default: }
An optional parameter that is an array of server names for this 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.
Sticky { numeric } { optional } { no default: }
An optional flag that causes this service to stick to a server, even if a higher order server comes online (see also sticky status).
Comments: Subroutine call only.
This subroutine is a member of the RPC Manager's Library, and must therefore be prefaced by \RPCManager\, as shown in the "Format" section. If the application you are developing is a script application, the subroutine call must be prefaced by System\RPCManager\, and the System variable must be declared in AppMod.src.
The return value from this call is a pointer to a variable that contains the current RPC status of this service instance. Dereferencing this pointer will yield one of three values:
0 – the status of the service instance is unknown at this time.
1 – this service instance is a client to another service instance.
2 – this service instance is the server instance.
Invalid – the caller of Register() has been slain.
This value will almost certainly be required by the service instance's code to allow it to operate correctly.
See Also:
ConnectToMachine | DisconnectFromMachine | GetServer | GetServersListed | GetStatus | IsClient | IsPotentialServer | IsPrimaryServer | Send | SetRemoteValue
You may also refer to RPC Manager Service for a listing of Service Control Methods, RPC Methods, and Deprecated RPC Methods.