Testing the Connection Between the SDK and the Server

The ruiTestConnection() function tests the connection between the SDK and the Server. If a valid configuration file exists from ruiCreateConfig(), the URL used for the test will be the one in that file, set by the Server. Otherwise, the URL used for the test will be the one set by the client in the call to ruiCreateConfig() . The proxy is used during the test if set by calling ruiSetProxy().

This function can be called between ruiCreateConfig() and ruiStopSDK() and can be called zero or more times.

This function is a synchronous function and only returns with all functionality is completed.

ruiTestConnection()

RUIRESULT ruiTestConnection(RUIINSTANCE* ruiInstance)

Parameters

The ruiTestConnection() function has the following parameters.

ruiTestConnection() Parameters

Parameter

Description

ruiInstance (RUIINSTANCE*)

Pointer to the RUI instance created via ruiCreateInstance().

Returns

The ruiTestConnection() function returns one of the return status constants below.

ruiTestConnection() Returns

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_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 from ruiCreateConfig() has not been successfully created.

RUI_SDK_ALREADY_STOPPED

SDK has already been stopped.

RUI_NETWORK_COMMUNICATION_ERROR

Not able to reach the Server.

RUI_NETWORK_SERVER_ERROR

Error while communicating with the Server.

RUI_NETWORK_RESPONSE_INVALID

Message format error while communicating with the Server.

RUI_TEST_CONNECTION_INVALID_PRODUCT_ID

Invalid Product ID.

RUI_TEST_CONNECTION_MISMATCH

Mismatch between Product ID and URL.