Server sync when network is detected

Hi, we are implementing the LexActivator in a service for Windows. I have realized that our service more often than not starts before the computer has an internet connection. This seems to make the first server sync to fail and it seems as the next one is scheduled according to the “Server Sync Interval” setting in the license. We have currently setup up our license to have a “Server Sync Interval” at 6 hours (thought it was nice to the server) and a “Server Sync Grace Period” at 1 day. So if a computer has been shut down for more than a day we will have to wait for 6 hours before the IsLicenseGenuine call will reply LA_OK.

If you have administrative “powers” you can restart the service and the problem is solved but that is not really a viable solution for us.

We could decrease the “Server Sync Interval” to 180 seconds and increase the “Server Sync Grace Period” to maybe 10 days. That will make the problem occur less often but it will still be a problem for a couple of minutes after startup if the computer have been shutdown or not had access to the internet for 10 days. One of the reasons we have implemented our software as a service is that we’d like the functionality of our software to work as soon as the computer starts.

Does anyone have a good solution for this? For example is there any way we can “force” LexActivator to do a server sync? Or is there a way to restart the thread handling the sync?


The purpose of grace period is to force the customer to connect to the server for server sync to succeed. Even if sync doesn’t happen for years, it doesn’t necessarily mean that license is invalid. The only purpose of server sync is to sync the changes made in the license (e.g. license metadata may be updated, the license could be extended, suspended etc.) with the client.

Hence, setting a grace period as small as 1 day is pointless, unless you update the license every date, which is highly unlikely. Ideally, it should be set to 0 (infinite grace period) unless you have a usecase which requires syncs to happen. You can set the sync to few months and that is completely fine.


Thanks for the response, I guess that we might have a special use for the grace period. One very important change to the license for our usage is if the license have been deactivated for a computer, in order to be activated on another computer. We would therefore like to have a “grace period” of around 2 weeks in order to let our customer be able to use our app off line for a reasonable period. We would however at the same time like to protect our software from being activated and used on multiple computers for any longer periods even in off line mode (I guess that off line mode can be purposely triggered on a computer with some fire wall rules).

The solution would work perfectly if we could do the following:
Check the license
if check returns grace period exceeded
check internet connection
if internet connection down
wait for internet
restart lexactivor or force lexactivator to do a resync


Your concern about license deactivation can be easily overcome if you do not deactivate the license server side (delete the license activation in the dashboard). If the license is deactivated from the client side, it will ensure that the app is no more licensed on that machine. The issue you are referring to will only happen if the license is deactivated server side, in that case, the license will continue to remain valid on the machine till server sync.

In your case I would recommend storing last used date of app in activation metadata. This can help you determine whether grace period was over due to the internet not being available for 14 days or app was used on the 15th day which caused LexActivator to return grace period over status code. In the later case you can wait for the status in the license callback. If status is LA_OK it means sync succeeded, and if it was LA_E_INET it would mean internet is not available on 15th day.