RTC Forums

Subscription => Support => Topic started by: HelgeLange on October 20, 2015, 03:27:26 PM



Title: Know when a server function wasn't called for any reason
Post by: HelgeLange on October 20, 2015, 03:27:26 PM
Hi Danijel,

I'm trying to make sure that from a mobile phone all communications go through. I know that there is a repost count property, that allows me to try several times. But it is entirely possible for a mobile phone to be offline for minutes and more while driving for example.
Is there any way to make sure that the messages leaves anyway as soon as we're online again?

The option I have would be a message stack with an unique Id that will be sent with every message and when I get the result, I clear that message from the stack. While I don't get any answer I try again every 10 seconds or so...

Any ideas ?
Thanks in advance, Helge


Title: Re: Know when a server function wasn't called for any reason
Post by: D.Tkalcec (RTC) on October 20, 2015, 03:57:28 PM
If you only want the TRtcClientModule component to keep trying unlimited number of times, the simplest solution is to set the AutoRepost property to -1. Then, the TRtcClientModule component will try sending each function call over-and-over-again, until it gets to the Server and a Result is received. This obviously won't work if your App closes before all remote calls have been sent out, but it does provide you with a simple "queue" which is handled by the RTC component.

If you want to implement your own mechanism for "receip acknowledgment" instead, to make sure that all your remote calls get through to the Server (which is something the components can not guarantee), you should set the AutoRepost property to the number of automatic repost attempts you want the components to make for you (but not to -1, which means "unlimited") and implement the "RequestAborted" event on the TRtcResult component (triggered on the component used for handling the Result) or the OnResponseAbort event on the TRtcClientModule component  (triggered for all remote calls made with the Client Module) to handle all "aborted" remote function calls. A remote function call will be "aborted" if the last remote function call attempt failed and no further attempts will be made.

Best Regards,
Danijel Tkalcec