Session IDs
RPC Manager maintains a Session ID (SID) for each instance of an application running on a remote machine. 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.
RPC Manager provides a SID so that your application can ensure integrity with a multi-server application instance. A SID will change value whenever reliable communication, for RPC, can no longer be maintained with a multi-server application instance. This can be caused by:
- Irrecoverable failure of the communication link to the remote machine. RPC Manager will do its best to recover communication, in the event of transient failure, but there will come a point when 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.
- Termination of the application instance on the remote machine. SIDs will indicate the termination and restart of a multi-server 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.
A SID remaining at the same value guarantees that all RPC requests are being reliably transported to the same target application instance.
A SID can be obtained from a number of sources:
- \RPCManager\GetSessionID(). This RPC Manager provided module can be called as a subroutine or run in steady state. It takes an application identifier and a machine identifier as parameters and returns the current SID for that application.
- \RPCManager\GetServerSIDPtr(). This RPC Manager provided module can also be called as either a subroutine or run in steady state. It 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 RPC Manager provided subroutine is used to issue an RPC. It will return the SID for the multi-server application instance for directed RPCs, , that was present at the moment the RPC was queued for transmission to the remote machine.
- \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.
An application can make use of the SID to ensure that it is still communicating with the same instance of an application as it was at some prior time. RPC Manager uses the SID for just such a purpose when synchronizing services .
Types of RPC
Services