TsgcWSPServer_sgcMethods › RPCResult

RPCResult Method

Replies to a pending RPC request with a successful result.

Syntax

procedure RPCResult(aID, aResult: String);

Parameters

NameTypeDescription
aIDStringId of the RPC request originally received by OnRPC; used to route the reply back to the calling client.
aResultStringResult payload placed in the JSON-RPC result field; can be a literal value or a JSON-encoded object/array.

Remarks

Call from the OnRPC handler once the method has executed successfully. The server locates the pending connection by aID, clears it from the method-id tracker and sends a JSON-RPC 2.0 success reply which the client surfaces through its OnRPCResult event. When QoS is Level 1 or 2 the reply is also added to the pending list so the server can resend it if no acknowledgment arrives.

Example

oProtocol.RPCResult(aID, '{"balance":1250}');

Back to Methods