Cleaning Zombie Login Sessions on a License Manager

Declare Variables/Constants

#define FEATURE_NAME      "Addition"
#define FEATURE_VERSION   "1"

sntl_licensing_attr_t *pZombieAttrAppContext = NULL;
sntl_licensing_attr_t *pZombieAttrLogin = NULL;
sntl_licensing_app_context_t *pZombieAppContext = NULL;
sntl_licensing_login_session_t *pZombieLoginSession = NULL;

API Calls

To clean Zombie sessions, execute the APIs in the specified sequential order only:

sntl_licensing_attr_new(&pZombieAttrAppContext);
sntl_licensing_app_context_new(0, pZombieAttrAppContext, &pZombieAppContext);
sntl_licensing_attr_new(&pZombieAttrLogin);
sntl_licensing_attr_set(pZombieAttrLogin, SNTL_ATTR_LOGIN_FEATURE_VERSION, FEATURE_VERSION);
sntl_licensing_attr_set(pZombieAttrLogin, SNTL_ATTR_LOGIN_ZOMBIE_SESSION, SNTL_ATTR_YES);
sntl_licensing_attr_set(pZombieAttrLogin, SNTL_ATTR_LOGIN_ZOMBIE_SESSION_IDENTIFIER_MASK, " 7 ");
sntl_licensing_login_attr(pZombieAppContext, FEATURE_NAME, pZombieAttrLogin, &pZombieLoginSession);
sntl_licensing_logout(pZombieLoginSession);

Notes

>This functionality is only available in network mode.

>If a contact server is not set, then broadcast will be performed to find the appropriate contact server for cleanup. If the server is found, only then cleanup will be performed.

>To close zombie sessions for all the features from the current machine, the keyword "$" should be used instead of the feature name in the feature name parameter defined for the login_attr API.

>For checked out commuter tokens and repository licenses, the cleanup zombie session is not supported.

Use Case Scenario

Consider the following steps that are a part of this use case:

1.The licensed application (client) requests a feature from the License Manager.

2.The licensed application gets terminated abnormally (due to a hardware failure, segmentation fault or any other unknown reason) without releasing the requested feature. However, The License Manager still reports that this particular feature is in-use. The licensed application session is still active.

3.The licensed application is restarted. It sends a request for the same feature, while the previous session is still active. This scenario can cause:

a.Feature/license overuse

b.Denial of license, when the License Manager considers that all token/seat count is in use.

NOTE   To avoid such scenarios, before requesting the same feature, the licensed application should clean up the previously issued keys or active sessions. The API sequence to close sessions (described under the topic) is triggered from the client-side. A system administrator on the customer's site can also close the active sessions. Refer to "Terminating Active User Sessions" for C, Java, and .NET for details.