RPC Manager maintains a session ID (or "SID") for each instance of an application running on a remote workstation. This SID should be treated as "opaque" data. It can be tested for equality or inequality with another SID, it can be tested against Invalid, and it can be tested for equality or inequality against the constant \RPCManager\RPC_NO_SID.
A SID is provided so that your application can ensure integrity with a remote application instance. A SID will change value whenever reliable communication for RPC can no longer be maintained with a remote application instance. Loss of reliable communication might be caused by:
• Irrecoverable failure of the communication link to the remote workstation. RPC Manager will do its best to recover communication in the event of transient failure, but there will come a point when the RPC Manager determines that RPCs can no longer be reliably delivered to the destination. In this case, the current SID will change to RPC_NO_SID; or
• Termination of the application instance on the remote workstation. SIDs will even spot the termination and restart of a remote application instance that occurs during a transient network failure. In this case the SID will change to RPC_NO_SID if no application instance is running, or to a new SID if a new application instance is running.
It follows that a SID remaining at the same value guarantees that all RPC requests are being reliably transported to the same target application instance.
A Session ID can be obtained from a number of sources:
• \RPCManager\GetSessionID(). This module is provided by the RPC Manager, and can be called as a subroutine or can run in steady state. The \RPCManager\GetSessionID() module takes an application identifier and a workstation identifier as parameters and returns the current SID for that application;
• \RPCManager\GetServerSIDPtr(). This module is also provided by the RPC Manager, and can also be called as a subroutine or can run in steady state. \RPCManager\GetServerSIDPtr() takes a service name and returns a reference to a variable holding the SID for the application instance that houses the current server for that service;
• \RPCManager\Send(). This module, provided by the RPC Manager, is used to issue a remote procedure call. \RPCManager\Send() will return the SID for the remote application instance for directed RPCs (see Types of Remote Procedure Calls (RPCs)) that was present at the moment the RPC was queued for transmission to the remote workstation; or
• \RPCManager\CurrentSessionID. This public variable is only valid during the execution of an RPC subroutine and contains the SID for the application instance that sourced the RPC request (see RPC Subroutines (Return Statement)).
An application can make use of the SID to ensure that it is still communicating with the same instance of an application, and that it has not switched to the instance of the application on a different workstation. RPC Manager uses the SID for just such a purpose when synchronizing services (see Services).
The section that follows discusses types of Remote Procedure Calls (RPCs).