Client-Side License Caching

RLM has the ability for a license to be cached on the client side, so that subsequent requests do not require communications with the license server. You can think of this as a very short-term, automatic, roam.

To enable this functionality, you do two things:

  1. Call a setup function in rlm_isv_config.c

  2. Add the optional “client_cache=xxx” attribute to the license

You should note that only licenses which have a sharing attribute without a share count will be usable as cached licenses. In other words, if the license has a “share=u” attribute, and the same user attempts a checkout, the cached license can be used. However, if the “share=” attribute is missing, or the share attribute is something like “share=u:8”, no checkouts of the cached license will be possible. Also note that the host attribute is matched automatically, by definition, since the license is being used on the same computer.


Enabling the functionality

To enable this capability, call:

rlm_isv_cfg_enable_client_cache(handle, 1);

in rlm_isv_config.c If you do not make this call, your application won’t write the data required by subsequent runs to avoid communications with the license server.

There are 2 new errors: RLM_EH_CACHEREADERR and RLM_EH_CACHEWRITEERR if the local cache file cannot be read or written.

Using client_cache

Once the functionality is enabled, add the “client_cache” attribute to the licenses which you wish to have this capability. For example:

client_cache=600

will cause the license to be cached on the application’s computer for 10 minutes. client_cache is specified in seconds, and the maximum time is 3600 (1 hour).

That is all you have to do. The RLM library implements client caching for you, and subsequent checkouts will use the cache file rather than attempting to contact the license server for a checkout.

rlm_license_xxx() and rlm_product_xxx() functions for use with client_cache

Function

Description

rlm_license_client_cache()

Returns the value of the client_cache parameter from the checked-out license.

rlm_license_cached()

Returns 1 if the checked-out license is a client_cached license, 0 otherwise.

rlm_product_client_cache()

Returns the value of the client_cache parameter from the license.


Server processing

Any license with a client_cache specification is treated by the license server identically to a license with a min_checkout specification. This is true whether or not you enable the client-side with rlm_isv_cfg_enable_client_cache(). The server does no other special processing for client_cache, only the minimum_checkout processing.

Note

If you don’t call rlm_isv_cfg_enable_client_cache() in rlm_isv_config.c, the server will still hold the license for the cache period, but the application won’t write the cache file, so subsequent checkouts will use the license server.


Notes on License and RLM versions

Licenses of different versions can be cached, and licenses checked out by software linked with different RLM versions can be cached as well. Software linked with a particular RLM version will only see licenses that were cached by the same version. This means that if you have 2 programs, linked with different RLM versions and checking out the same license, you will see a separate checkout at the server for each program, then subsequent invocations of each program will use the corresponding cached license until expiration.


RLM_DIAGNOSTICS

Client Cached licenses will appear in RLM_DIAGNOSTICS output, however, only the highest version license enabled for any given product name will appear. And only a license which was cached by a program using the same version of RLM.


rlm_products()

Client cached licenses will never appear in the list of licenses returned by rlm_products().