EnableNetworkErrorMessageCaching
Enables the timeout message caching which is disabled by default. Once enabled, if a client side timeout is encountered (i.e. brainCloud server is unreachable presumably due to the client network being down) the SDK will do the following:
- cache the currently queued messages to brainCloud
- call the network error callback
- then expect the app to call either:
- RetryCachedMessages() to retry sending to brainCloud
- FlushCachedMessages() to dump all messages in the queue.
Between steps 2 & 3, the app can prompt the user to retry connecting to brainCloud to determine whether to follow path 3a or 3b.
Note that if path 3a is followed, and another timeout is encountered, the process will begin all over again from step 1.
The brainCloud SDK will cache all API calls sent when a timeout is encountered if this mechanism is enabled. This effectively freezes all communication with brainCloud. Apps must call either RetryCachedMessages() or FlushCachedMessages() for the brainCloud SDK to resume sending messages. ResetCommunication() will also clear the message cache.
Method Parameters
Parameter | Description |
---|---|
enabled | True if message should be cached on timeout |
Usage
- C#
- C++
- Objective-C
- Java
- JavaScript
- Dart
- Cloud Code
- Raw
_bc.EnableNetworkErrorMessageCaching(true);
_bc->enableNetworkErrorMessageCaching(true);
[_bc enableNetworkErrorMessageCaching:true];
_bc.enableNetworkErrorMessageCaching(true);
// N/A
_bc.enableNetworkErrorMessageCaching(true);
// N/A
// N/A