Application does not synchronize with the server at startup


#1

Hello,
I am using LexActivator V2.9.0. I have a question.

My application extends the license expiration date every year.
Therefore, if the user purchases an extension of the license expiration date, I will extend “License Validity” in cryptlex.com.
After that, the user presses the update button of the application. By activating again, the application synchronizes with the server and extends the license expiration date. “activating again” means to call LexActivator.SetProductKey.
The reason for doing this is that the application does not automatically synchronize with the server at startup, and the license expires.

It is cumbersome for the user to press the application button for extending the license expiration date.
I want to extend the license’s expiration date by automatically synchronizing with the server at application startup. My application runs the following program at startup, but it does not synchronize with the server every other day.
(I execute “LexActivator.SetDayIntervalForServerCheck (1)”)
How can I solve this problem?

var status = LexActivator.SetProductFile(_ProductFilePath);
if (status != LexActivator.LA_OK)
{
	throw new Exception(status);
}
status = LexActivator.SetVersionGUID(_VersionGuid, LexActivator.PermissionFlags.LA_USER);
if (status != LexActivator.LA_OK)
{
	throw new Exception(status);
}
status = LexActivator.SetUserLock(true);
if (status != LexActivator.LA_OK)
{
	throw new Exception(status);
}
status = LexActivator.SetDayIntervalForServerCheck(1);
if (status != LexActivator.LA_OK)
{
	throw new Exception(status);
}
status = LexActivator.SetGracePeriodForNetworkError(0);
if (status != LexActivator.LA_OK)
{
	throw new Exception(status);
}
status = LexActivator.IsProductActivated();
if (status != LexActivator.LA_OK)
{
	throw new Exception(status);
}
status = LexActivator.IsProductGenuine();
if (status != LexActivator.LA_OK)
{
	throw new Exception(status);
}

#2

Hi,

Are you sure you waited for 24 hrs for the sync? In v2 if app remains open sync happens only once. So if app remains open for two days sync will happen only once unless restarted or IsProductGenuine() is called again.

NOTE: This changed in v3 and sync occurs on every startup and further syncs happen every 3600 seconds till app remains open.


#3

Are you sure you waited for 24 hrs for the sync? In v2 if app remains open sync happens only once. So if app remains open for two days sync will happen only once unless restarted or IsProductGenuine() is called again.

Yes, waiting 24 hours or more, I started the application, but it did not automatically synchronize with the server and extend the license’s expiration date of the license.

Sorry.
After expiration of 24 hours or more, the expiration date of the license was extended at the time of the second application startup.
I confirmed it with a virtual machine of Windows 10(x64) in Hyper-V.
The expiration date of the license is not extended for the first startup, and the license is updated by the second application startup immediately after that.
My application runs the source code listed in the first question at startup.

Why is the license updated by the second application startup.
Is there any other condition to synchronize with the server?


#4

Hi,

In v3 it synchronizes on every startup, but in v2 it synchronizes on the date for which sync is scheduled.


#5

The expiration date of the license is not extended for the first startup, and the license is updated by the second application startup immediately after that.

I understand that the above reasons are as follows.

IsProductGenuine () function does server sync in a separate thread

The above sentense was in the following post.

I execute GetDaysLeftToExpiration () immediately after executing IsProductGenuine ().
So, running GetDaysLeftToExpiration () before server sync in a separate thread will get the expiration date of the license before updating.
Is my understanding correct?


#6

Yes, IsProductGenuine() is an async function. But when you will run your app next time, by when server sync is done, you will get the latest value.