Throttling - Xenoage/RpcLib GitHub Wiki
In case of network problems, calls from the client to the server are automatically throttled. The first call after an error happens a second later. Then, if the problem still persists, two seconds later, then four, eight, and so on. The maximum time between the attempts is 60 seconds for server pulls (long polling) or 50% of the timeout for commands.
When the server can be reached again, the following commands will be sent immediately again.
The server side needs no throttling, because it just reponds to the calls from the client (direct calls from the client, and long polling from the client to get the server's commands). Thus, the client is always reachable from the viewpoint of the server.
Throttling is implemented in the RpcClientEngine
, see the usages of the field secondsUntilNextTry
.