Stopping the SDK
The ruiStopSDK() function stops the SDK that was started with ruiStartSDK(). This function should always be called at the exit point of your application.
If explicit sessions are allowed (multiSessionsEnabled = true in ruiCreateConfig()), then any sessions that have been started with ruiStartSession() that have not been stopped with ruiStopSession() are automatically stopped. A manual synchronization with the Server, ruiSync(), will be performed at stop depending on the value of doSync (as described in Parameters).
ruiStopSDK() must be called after ruiStartSDK() and must be called only once. After ruiStopSDK() is called, the various event tracking APIs are no longer available. The only APIs available are ruiGetState() and the ruiDestroyInstance(). The SDK cannot be re-started with a subsequent call to ruiStartSDK().
ruiStopSDK() is a synchronous function, including the manual synchronization with the Server (if requested), returning when all functionality is completed.
RUIRESULT ruiStopSDK(RUIINSTANCE* ruiInstance, int32_t doSync)
The ruiStopSDK() function has the following parameters.
Parameter |
Description |
|||||||||
ruiInstance (RUIINSTANCE*) |
Pointer to the Usage Intelligence instance created via ruiCreateInstance() |
|||||||||
Indicates whether to do a manual synchronization as part of the stop, and if so, the wait limit. A manual synchronization with the Server, ruiSync(), will be performed at stop depending on the value of doSync:
|
Returns
The ruiStopSDK() function returns one of the return status constants below.
Return |
Description |
RUI_OK |
Function successful. |
RUI_INVALID_SDK_OBJECT |
SDK Instance parameter is NULL or invalid. |
RUI_SDK_INTERNAL_ERROR_FATAL |
Irrecoverable internal fatal error. No further API calls should be made. |
RUI_SDK_ABORTED |
A required New Registration has failed, and hence the SDK is aborted. ruiStopSDK() and ruiDestroyInstance() are possible. |
RUI_CONFIG_NOT_CREATED |
Configuration has not been successfully created. |
RUI_SDK_NOT_STARTED |
SDK has not been successfully started. |
RUI_SDK_ALREADY_STOPPED |
SDK has already been successfully stopped. |
RUI_INVALID_DO_SYNC_VALUE |
The doSync manual sync flag/limit violates its allowable range. |