License validation behavior when server not available

Hi,

I'd like to know what happens to an activated apps that tries to validate a license if the LimeLM server becomes unavailable (Internet is working but the server cannot be reached). How is that case handled by TurboActivate.IsGenuine?

Since we offer perpetual licenses, it becomes a concern over the long term that an application may refuse to run because the license fails to validate when the server is not available. Not the user's fault in that case, and unjust to just stop the app from working.

Thanks for your input.

I'd like to know what happens to an activated apps that tries to validate a license if the LimeLM server becomes unavailable (Internet is working but the server cannot be reached). How is that case handled by TurboActivate.IsGenuine?

If you open the code comments (you're using C# or VB.NET right?) you'll see an in-depth explanation. Ctrl + CLick the IsGenuine() function to go to the function definition and you'll see the explanation.

Here's the explanation from TurboActivate.h (same explanation, slightly different formatting):

Checks whether the computer is genuinely activated by verifying with the LimeLM serversafter a certain number of days you specify.


This is meant as a replacement of both IsActivated() and IsGenuine(). Call this at thetop of your program and let IsGenuineEx() handle all the details.


This differs with IsGenuine() in 3 major ways:


     1. You can specify how often to verify with the LimeLM servers and it handles        all the date tracking behind the scenes.




     2. IsGenuineEx() prevents your app from hammering the end-user's network after        and TA_E_INET error return code by not checking with the LimeLM servers until        at least 5 hours has passed. If you call IsGenuineEx() after a TA_E_INET return        and before 5 hours has elapsed then this function will return TA_E_INET_DELAYED.


        (If you give the user the option to recheck with LimeLM, e.g. via a button        like "Retry now" then call IsGenuine() to immeditately retry without waiting 5 hours).




     3. If a TA_E_INET error is being returned, and the grace period has expired,        then IsGenuineEx() will return TA_FAIL. IsGenuineEx() will continue to try        contacting the LimeLM servers on subsequent calls (5 hours apart), but you        should treat the TA_FAIL as a hard failure.




Returns: TA_OK or TA_E_FEATURES_CHANGED on success. Handle TA_E_INET and TA_E_INET_DELAYED as warnings that         you should let the end user know about.


         Handle all other return codes as failures.


Possible return codes: TA_OK, TA_FAIL, TA_E_ACTIVATE, TA_E_INET, TA_E_GUID                       TA_E_PDETS, TA_E_COM, TA_E_EXPIRED, TA_E_REVOKED,                       TA_E_INVALID_ARGS, TA_E_INVALID_FLAGS, TA_E_IN_VM,                       TA_E_INET_DELAYED, TA_E_FEATURES_CHANGED

Short answer: there's a grace period where you can notify the user if their internet is acting faulty (they can't access the server).

Is that helpful?

From what I understand, whatever the point of failure in the communication chain, it will be treated as a InternetError. There is no particular effort to determine where the failure occurs. The LimeLM could be offline or the customer's firewall could be blocking the call, it's all the same. Am I interpreting this right?

The LimeLM could be offline or the customer's firewall could be blocking the call, it's all the same. Am I interpreting this right?

Yes, those are 2 possibilities that could cause an internet error. However, there could be a billion reasons for the error. TurboActivate doesn't do diagnostics on the computer and network to find exactly where the error. We leave that up to the end-user (your customers).

You should just tell them an internet error occurred and let them figure it out, rather than trying to guess what origin of the error is.

We have very good uptime. On the rare occurrences of unplanned downtime we're immediately notified and we work as fast as possible to get everything back up. We take uptime very seriously.

I'm pretty confident about your up time. I certainly was not trying to imply anything. We just need to figure out how to handle the inevitable failure, particularly in the long term, because we provide perpetual licenses.

If all network failure are handled the same way, wherever they may occur down the comm chain, then it's fine. I was afraid we may get some error code that we don't handle, at some point.

We also have a common scenario where customers will be using our products disconnected (on shipping floors for example) for long period of time. That will also fall into the network error category, supposedly.

What we plan on doing is let the application run when an internet error is reported, indefinitely, assuming it was activated in the first place, of course. From what I'm gathering that will cover pretty much all the cases, disconnected long term and unreacheable LimeLM server.

Well, if you want the user to continue to use your app even if the user blocks the internet then you can use the IsGenuineEx() function as it is right now, but all check IsActivated() in the case where IsGenuineEx() returns NotGenuine.

What I've done so far is what you were saying but inside out it seems. It is based on the sample code. Basically, if not activated then activate otherwise check for license validity. If internet error, ignore the error and let app run. If not valid close app otherwise fall through and let run. I'm currently testing with a validation period of 1 day and a grace period of 1 day to speed things up.

try { // If we are activated then don't contact the server anymore - just run if (!TurboActivate.IsActivated()) { // Activate } else { // Periodically check for license validity

// Check if we're activated, and every 90 days verify it with the activation servers // In this example we won't show an error if the activation was done offline // (see the 3rd parameter of the IsGenuine() function) -- http://wyday.com/limelm/help/offline-activation/ gr = TurboActivate.IsGenuine(1, 1, true);

_isActivated = gr == IsGenuineResult.Genuine || gr == IsGenuineResult.GenuineFeaturesChanged || // an internet error means the user is activated but // TurboActivate failed to contact the LimeLM servers gr == IsGenuineResult.InternetError;

if (gr == IsGenuineResult.InternetError) { // Ignore this error - since we entered this section because we were activated in the first place then make sure flag still reflects that _isActivated = true; return; }

// If after validation it is found that the license is no longer valid then warn user. Application should exit. if (!_isActivated && gr != IsGenuineResult.InternetError) { // Inform user and stop application } } }

} catch (TurboActivateException ex) { MessageBox.Show("Failed to check if activated: " + ex.Message + ". Application will now close."); }

Here's a better way to do what you're trying to do:

try{    // Check if we're activated, and every 90 days verify it with the activation servers    // In this example we won't show an error if the activation was done offline    // (see the 3rd parameter of the IsGenuine() function) -- http://wyday.com/limelm/help/offline-activation/    IsGenuineResult gr = TurboActivate.IsGenuine(90, 14, true);


    isActivated = gr == IsGenuineResult.Genuine ||                  gr == IsGenuineResult.GenuineFeaturesChanged ||


                  // an internet error means the user is activated but                  // TurboActivate failed to contact the LimeLM servers                  gr == IsGenuineResult.InternetError;


    if (gr == IsGenuineResult.InternetError)    {        //TODO: give the user the option to retry the genuine checking immediately        //      For example a dialog box. In the dialog call IsGenuine() to retry immediately    }    else if (gr == IsGenuineResult.NotGenuine)    {        isActivated = TurboActivate.IsActivated();    }}catch (TurboActivateException ex){    MessageBox.Show("Failed to check if activated: " + ex.Message);}

This tries to verify online, but if it fails to contact the servers after the grace period has expired, it just checks the local activation.

Does that help?