cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
eaduro
Level 3

lc_get_server_version returns zero version

Jump to solution

Hi,

To get the NLM version we do the following but we get zero version. To make it work,  we append "@" at the beginning of license_path.  Is this the expected behavior?  Note that even if an unreachable server is put into as license_path, it will return version as 0.0.0.0 <major>.<minor>.<build>.<patch>.

const char *license_path = "<IP/hostname>"

lc_new_job((LM_HANDLE *)0, lc_new_job_arg2, &vendorCode, &job);
lc_set_attr(job, LM_A_APP_DISABLE_CACHE_READ, (LM_A_VAL_TYPE) 1);
lc_set_attr(job, LM_A_LICENSE_DEFAULT, (LM_A_VAL_TYPE) license_path);
lc_get_server_version(job, FNP_SERVER_TYPE_LIC_MANAGER, &lm_flexnet_ver);
lc_get_server_version(job, FNP_SERVER_TYPE_VENDOR_DAEMON, &vd_flexnet_ver);

 

0 Kudos
(1) Solution
Yvernekar
Level 5 Flexeran
Level 5 Flexeran

If you are using localhost, IP, or just hostname it needs to be appended with "@" at the beginning. 

Also, unfortunately the API does not return an error like you expect it just returns 0's when it is not able to connect.

View solution in original post

0 Kudos
(5) Replies
Yvernekar
Level 5 Flexeran
Level 5 Flexeran

Hi,

If the server is not reachable or if the path set is wrong "0.0.0.0" is an expected output.
Please try to run lmstat on the client system and check if the client is able to communicate with the server and then check once if lc_get_server_version returns the correct value. 

0 Kudos

As I was saying using an active NLM server, appending "@" at the beginning would return the correct version but without it it will just be "0.0.0.0".

For unreachable server, we expect the lc_get_server_version to return an error like this:

Cannot connect to license server system.\n The license server manager (lmgrd) has not been started yet,\n the wrong port@host or license file is being used, or the\n port or hostname in the license file has been changed.\nServer name: x.x.x.x\nLicense path: @x.x.x.x;\nFlexNet Licensing error:-15,570 (error code -15)'"


0 Kudos
Yvernekar
Level 5 Flexeran
Level 5 Flexeran

If you are using localhost, IP, or just hostname it needs to be appended with "@" at the beginning. 

Also, unfortunately the API does not return an error like you expect it just returns 0's when it is not able to connect.

0 Kudos

Actually, lc_get_server_version does return that error when appended with "@".  I've tested this.

Yvernekar
Level 5 Flexeran
Level 5 Flexeran

As per my knowledge, lc_get_server_version returns 0 if Success or any other value is it is a Non-success.

0 Kudos