FWRPC
FWRPC():New()Controls RPC connections and remote execution without a distributed transaction.
Overview
Documentation covers reconnection, environment preparation and CallProc with up to 26 arguments beyond the routine name. This page does not specify how to supply server or credentials; the example only constructs the object and sets retries and timeout, without invented connection properties. SetTimeOut takes seconds; zero delegates timing to the operating system. (Sources: refs. 1–1.)
Syntax
FWRPC():New()Methods
SetRetryConnectLimits retries; default 3.o:SetRetryConnect(nRetry)
SetTimeOutSets connection timeout in seconds.o:SetTimeOut(nSeconds)
ConnectConnects to configured destination.o:Connect() -> lResult
SetEnvPrepares remote environment.o:SetEnv(cEmp,cFil,cModulo,aTabelas,cFunName) -> lResult
CallProcReturns remote routine result.o:CallProc(cRotina,...) -> xResult
DisconnectCloses connection.o:Disconnect() -> lResult
Commented example
#Include "Protheus.ch"
User Function Ed450()
Local oRpc := FWRPC():New()
// Local configuration: no connection is opened.
oRpc:SetRetryConnect(1)
oRpc:SetTimeOut(5)
FreeObj(oRpc)
Return NilConfigures one retry and a five-second timeout; no remote call. Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.
- Check Connect and SetEnv before CallProc. Reconnection guarantees neither idempotency nor rollback of completed effects.
- Under review: editorial example neither compiled nor run in Protheus. Check includes, release, RDD and context before testing.

Comments
There are no approved comments yet.
Sign in with Google or Microsoft to comment.