Summary
Is there an API that can get the time each user of a feature acquired the license?
Question
We're trying to figure out how to get the time each use of a feature actually acquired the license. When they have a feature, the users consuming that feature's license are returned from the line below:
users = lc_userlist(lm_job, feature);
This is a list of structures of type LM_USERS which has a member time. This timestamp would be helpful for reports if it is the time the particular user checked out the license. However, it appears the value of the timestamp is basically unpredictable and there doesn't appear to be any documentation regarding what it really is.
We're interested in the time each particular user of a feature acquired the license to that feature from the server. Can we get it from the lc_userlist 'If not, any other API' Does LM_A_VD_GENERIC_INFO provide the information we require?
Please note, this detail is available via LMTools under Server Status-> Individual Feature -> Perform Status Enquiry.
Answer
You can get the desired information using the below code snippet.
users = lc_userlist(lm_job, feature);
printf("Start time = %s", ctime(&users->next->time));
printf("Feature = %s\n", feature);
printf("User = %s\n", users->next->name);
Additional Information
The list of users returned by lc_userlist() includes a special record, indicated by an empty user name (name[0]==0), which contains the total number of licenses supported by the daemon for the specified feature (in the nlic field), and the daemon's idea of the current time (in the time field). To obtain the vendor daemon's current time you have to specifically reference that special record.
For example:
users = lc_userlist(lm_job, feature);
while (users)
{
if (users->time != 0 && users->name[0] != 0)
{
printf("%s, %s, %ld\n", users->name, users->node);
time (&rawtime);
t = localtime (&rawtime);
strftime(buffer, 80, "Checkout time: %I:%M%p\n", t);
puts (buffer);
}
users=users->next;
}
Also, you can obtain the timestamp using LM_A_VD_GENERIC_INFO, for example:
c = (CONFIG *)0;
for (conf = lc_next_conf(lm_job, feature, &c);conf;
conf=lc_next_conf(lm_job, feature, &c))
{
gi.feat = conf;
if (lc_get_attr(lm_job, LM_A_VD_GENERIC_INFO, (short *)&gi))
{
lc_perror(lm_job, "LM_A_VD_GENERIC_INFO");
}
else
{
server_time = gi.server_current_time;
t = localtime(&server_time);
printf("License was checked out at %d:%d:%d\n", t->tm_hour, t->tm_min, t->tm_sec);
}
}Related Articles
Cannot Acquire License from Trusted Storage After Restart 9Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago