How to drop all leased licenses safely in floating client?

Hello,

In following case, what is the correct way to unlease all leased licenses?

Background:
- There're 2 floating servers (server X and Y) on the network
- There's 1 floating client (client A) on the network

Situation:
- Client A is leased a license from Server X
- At some point Server X is disconnected from the network
- So, now we changed Client A to use Server Y instead of Server X
- Before start using Server Y, Client A tries to drop the license from Server X, but since Server X is not connected to the network, Client A cannot drop the license.

In this case, if Client A change its configuration to use Server Y, Client A will keep two of licenses leased (one from Server X and the other one from Server Y)
When Server X is connected back to the network, I believe Server X will lease the license to Client A, as Client A did not drop license before changing Server Y.

So, to avoid such case, somehow I want to flush all internal leased license inside of Client A, before changing its configuration to Server Y. So, once Server X unleased the license upon leasing time ends, the license will not be leased back to Client A anymore.

I believe GlobalClenaUp will not clean up leased license.
Should I close the process once and restart to clean up all leased licenses?
What would be a proper way to clean up leased license info in such case.

Please let me know.

Comments

  • Hi,

    Just calling DropLicense() would be enough, because irrespective of whether it fails or succeeds, the license handle is invalidated. So the thread which automatically refreshes the license won't send a lease refresh request to Server X, as DropLicense() invalidated the license handle.
  • edited January 13
    Hello,

    Got it.

    I tested more and I encountered the case GetHandle kept returning error (error code 13) case after changing ProductFile. Once got into this state, I need to terminate the process to recover from the state.

    Can you test with something like following code?

    unsigned int handle = 0;

    SetProductFile(PRODUCT_A)
    GetHandle(&handle)
    SetFloatServer(handle, localhost, 8090)
    SetLicenseCallback(handle)
    RequestLicense(handle)
    ...
    DropLicense(handle)
    handle = 0;
    SetProductFile(PRODUCT_B)
    GetHandle(&handle)
    SetFloatServer(handle, localhost, 8091)
    SetLicenseCallback(handle)
    RequestLicense(handle)
    ...
    DropLicense(handle)
    handle = 0;

    If above way is not correct, please let me know proper way which you guys made sure working correctly over there.

    NOTE: it may work for first couple of trials, but eventually it stops working. Please keep doing til it started failing.

    Best,
  • Hi,

    You can only use one product file per process. Why are you using a different product file for the second server, when it is actually a backup server for the first.
  • Hello

    I only use a one product file at a time. So I'm calling SetProductFile to change "active" product.

    It is also not allowed to do so?

    in our workflow, there's a case to switch product file over the time. It is due to some complication of our requirements...
  • You can't change the product file once it's set. Only one product file can be used once it's set.
  • Okay...

    How about switching between node-Locked and floating license in one process?
    That is also not allowed?
  • LexFloatActivator and LexFloatClient are separate libraries, that should not be an issue.
  • Got it. Thanks!
Sign In or Register to comment.