IsPrimaryServer
(RPC Manager Library)
Description: | Returns 1 if the local machine is connected to the primary server for the specified service. |
Returns: | Integer |
Usage: | Steady State only. |
Function Groups: | Network |
Related to: | ConnectToMachine | DisconnectFromMachine | GetServer | GetServersListed | GetStatus | IsClient | IsPotentialServer | Register (RPC Manager) | Send | SetRemoteValue |
Format: | \RPCManager\IsPrimaryServer(ServiceName [, OptGUID]) |
Parameters: |
ServiceName |
Required. The name by which the service is known. |
OptGUID |
Any optional parameter that provides the GUID of the application in which the service instance is known. The default is the application to which the caller belongs. |
Comments: |
This module 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 module call must be prefaced by System\RPCManager\, and the System variable must be declared in AppRoot.src. To obtain a list of service names for your application, open the Trace Viewer Application, connect to RPC Diagnostics, then open the Services Dialog The return value from this module is a logical value, if true (1) the primary server is the active server for the service, if false (0) a backup or no server is active is active. To determine if a workstation is the current RPC server for a service call RPCManager\GetStatus.
To obtain a list of service names for your application, open the Trace Viewer Application, connect to RPC Diagnostics, then open the Services Dialog |
Example:
If \RPCManager\IsPrimaryServer("ModemManager") Main;
[
...
]