Testing the Connection Between the SDK and the Server
The RUISDK.TestConnection method tests the connection between the SDK and the Server. If a valid configuration file exists (RUISDK.CreateConfig), 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 RUISDK.CreateConfig . The proxy is used during the test (RUISDK.SetProxy).
This method allows you to test your application’s connectivity with the Usage Intelligence server and to confirm that your CallHome URL is active and operational (for debugging purposes when using a custom CallHome URL). You do NOT need to call this method before other API calls since this would cause unnecessary traffic on your clients’ machines. Instead, you should check the return types by each API call since every API call that requires server communication does its own connection status check and returns any connection errors as part of its return type.
RUISDK.TestConnection can be called between RUISDK.CreateConfig and RUISDK.StopSDK and can be called zero or more times.
RUISDK.TestConnection is a synchronous function, returning when all functionality is completed.
RUIResult RUISDK.TestConnection ()
Returns
The RUISDK.TestConnection method returns a RUIResult enum value with the following possible values.
Return |
Description |
ok |
Function successful. |
sdkInternalErrorFatal |
Irrecoverable internal fatal error. No further API calls should be made. |
sdkAborted |
A required New Registration has failed, and hence the SDK is aborted. RUISDK.StopSDK and RUISDK destructor are possible. |
sdkPermanentlyDisabled |
Instance has been instructed by Server to disable. This is permanent, irrecoverable state. |
sdkOptedOut |
Instance has been instructed by the application to opt-out. |
configNotCreated |
Configuration has not been successfully created. |
sdkNotStarted |
SDK has not been successfully started. |
sdkAlreadyStopped |
SDK has already been successfully stopped. |
networkConnectionError |
Not able to reach the Server. |
networkServerError |
Error while communicating with the Server. |
networkResponseInvalid |
Message format error while communicating with the Server. |
testConnectionInvalidProductID |
Invalid ProductID. |
testConnectionMismatch |
Mismatch between URL and ProductID. |