RPC HELP TSharedRPCBroker OnConnectionDropped Property
OnConnectionDropped Property
Applies to
TSharedRPCBroker component
Declaration
property OnConnectionDropped: TOnConnectionDropped;
Description
The OnConnectionDropped property is used to provide a capability for handling a connection loss. Loss of a connection to the VistA M Server may be recognized when an RPC call is made, or it may be recognized when the RPCBroker sends its background messages to the VistA M Server at intervals of 45 to 60 seconds to let the server know that the application is still connected. Since, with the SharedRPCBroker, this loss would be recognized in the RPCSharedBrokerSessionMgr and not in the individual applications, they would not normally be aware of this problem until another RPC call is made. To promptly notify the application, the RPCSharedBrokerSessionMgr will send a message back to the applications that have implemented a procedure for the OnConnectionDropped property. This procedure would accept as arguments an integer (the connection index) and a WideString containing any error text for the disconnection. As indicated by the TOnConnectionDropped declaration.
A default procedure is supplied that will display a dialog box indicating the loss of connection and any error text supplied. If further processing is desired, a custom procedure should be created and the OnConnectionDropped property set to it.
TOnConnectionDropped = procedure (ConnectionIndex: Integer; ErrorText: WideString) of object;
This indicates the format of the procedure and arguments required for a method to be used as the OnConnectionDropped property.