PDA

View Full Version : license checkout returns success when it should fail.



uglynn
06-11-2014, 12:53 PM
We're trying to integrate with the flexlm using the C++ libraries. We're talking to a server that has one license of the appropriate type. We check out the first license by making a call to the following line:

int lc_result = lc_checkout(lm_job, const_cast<LM_A_VAL_TYPE>(_feature.c_str()), const_cast<LM_A_VAL_TYPE>(_version.c_str()), numLicenses , LM_CO_WAIT, &code, LM_DUP_NONE);

(numLicenses, in this case, is 1)

lc_checkout returns 0 in the first instance, indicating the checkout was successful, and the log from the license server itself shows that the checkout was successful. If we were to try to check out a second license, again calling the same lc_checkout function, it once again returns 0, indicating that the checkout was successful. However, if we were to look at the license log, we would see, correctly: "19:13:30 (spirentd) DENIED: "VELOCITY_PLAY" root@eric-itp2 (Licensed number of users already reached. (-4,342:104 "Connection reset by peer"))"

But this is inconsistent--if this is the case, lc_checkout SHOULD be returning a non-zero value (-4, if I've read the error codes correctly) to indicate there was an error. This makes it impossible to know that the checkout actually failed and seems like incorrect behavior. Is there anything that can be done to get around this and be able to successfully catch the error to the licensing call?