Disabled Local Renewal While Using Auto-Refresh Functionality

Declare Variables/Constants

#define FEATURE_NAME           "Feature1"

#define CONTACT_SERVER         "localhost"

sntl_licensing_attr_t *pAttrAppContext = NULL;
sntl_licensing_app_context_t *pAppContext = NULL;
sntl_licensing_login_session_t *pLoginSession = NULL;

API Calls

To disable local renewal, execute the APIs in the specified sequential order only:

sntl_licensing_attr_set_appcontext_contact_server (pAttrAppContext, CONTACT_SERVER);

NOTE   If instead the LSFORCEHOST or LSHOST environment variables are set, then the above-mentioned steps are not required.

sntl_licensing_attr_set_appcontext_auto_refresh(pAttrAppContext, "yes");
sntl_licensing_attr_set_appcontext_local_renewal_flag(pAttrAppContext, "no");
sntl_licensing_app_context_new(0, pAttrAppContext, &pAppContext);
ntl_licensing_login(pAppContext, FEATURE_NAME, &pLoginSession);

While using the auto-refresh (with local renewal enabled) functionality, there is a possibility that the refresh call reaches the License Manager post the license/key expiry. In such cases, the licensed application may experience failure due to inability of the License Manager to refresh the logged in session because of insufficient tokens.

Therefore, it is recommended to always disable local renewal while using the auto-refresh functionality.