Stopping a Session
The ruiStopSession() function stops an explicit session started with ruiStartSession().
Explicit sessions are allowed only if ruiCreateConfig() was called with multiSessionEnabled = true. Any explicit sessions not ended with a call to ruiStopSession() are automatically ended when ruiStopSDK() is called. In case this method is never called, eventually this session will be considered as “timed-out”, and the time of the last recorded event will be assumed to be the time when the last event was recorded.
ruiStopSession() can be called between ruiStartSDK() and ruiStopSDK(), and can be called zero or more times.
ruiStopSession() is a synchronous function, returning when all functionality is completed.
RUIRESULT ruiStopSession(RUIINSTANCE* ruiInstance, const char* sessionID)
Parameters
The ruiStopSession() function has the following parameters.
Parameter |
Description |
ruiInstance (RUIINSTANCE*) |
Pointer to the RUI instance created via ruiCreateInstance(). |
sessionID (const char*) |
A current valid session ID to be stopped (content conditioning and validation rules in ruiStartSession()). |
Returns
The ruiStopSession() 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_SDK_SUSPENDED |
The Server has instructed a temporary back-off. |
RUI_SDK_PERMANENTLY_DISABLED |
The Server has instructed a permanent disable. |
RUI_SDK_OPTED_OUT |
Instance has been instructed by the application to opt-out. |
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_SESSION_ID_EXPECTED_NON_EMPTY |
The sessionID is expected to be non-empty, and it was not. |
RUI_INVALID_SESSION_ID_TOO_SHORT |
The sessionID violates its allowable minimum length. |
RUI_INVALID_SESSION_ID_TOO_LONG |
The sessionID violates its allowable maximum length. |
RUI_INVALID_SESSION_ID_NOT_ACTIVE |
The sessionID is not currently in use. |