Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


The information on this page refers to LM-X v5.4 or newer, which introduced LMX_OPT_TRIAL_CLOUD_HOST.

The LMX_SetOption function sets flags that change licensing behavior prior to license checkout.

Prototype

Code Block
languagecpp
LMX_STATUS LMX_SetOption

...


(
   LMX_HANDLE LmxHandle,

...


   LMX_SETTINGS eOption,

...


   const void *pSetting

...


);

Parameters

LmxHandle
[in/out] LM-X handle.

...

pSetting
See the Setting information for the specific option, listed below.

Note: To avoid warnings when using the pSetting parameter, you can typecast it to the type (LMX_OPTION).

...

The functions for LMX_SetOption are listed below.  

Note: Unless otherwise specified, the LMX_SetOption options affect checkout requests.

...

 

...

...

pSetting

...

 

  
  

 

...

eOption

...

...

...

...

...

...

pSetting

...

...

 

...

eOption

...

...

...

...

...

...

...

...

...

pSetting

...

Function pointer value.
Default value:
NULL (disabled)
Prototype:
void (LMX_CALLBACK *HeartbeatConnectionLost_pfn)
(
void pVendorData, / Vendor-specified data */
const char szHost, / NULL-terminated string containing license server host */
int nPort, /* TCP port number of license server */
int nFailedHeartbeats /* The number of times a heartbeat has failed per server*/
);

 

...

eOption

...

...

...

...

pSetting

...

Function pointer value.
Default value:
NULL (disabled)
Prototype:
void (LMX_CALLBACK *HeartbeatExit_pfn)
(
void pVendorData, / Vendor-specified data */
);

 

...

eOption

...

...

pSetting

...

Void pointer value.
Default value:
NULL

 

...

eOption

...

...

pSetting

...

Function pointer value.
Default value:
NULL (disabled)
Prototype:
LMX_STATUS (LMX_CALLBACK *CustomHostidCallBack_pfn)
(
LMX_HOSTID *pHostid,
int *npHostids
);
See LMX_Hostid for information on using this callback function.

 

...

eOption

...

...

pSetting

...

Function pointer value.
Default value:
NULL (disabled)
Prototype:
LMX_STATUS (LMX_CALLBACK *HostidCompareCallBack_pfn)
(
LMX_KEY_HOSTID_TYPE eKeyHostidType, /* LMX_CLIENT_HOSTID or LMX_SERVER_HOSTID expected */
const LMX_HOSTID pLicenseHostid[],
int nLicenseHostids,
const LMX_HOSTID pSystemHostid[],
int nSystemHostids
);
See Custom HostID compare for information on using this callback function.

 

...

eOption

...

...

pSetting

...

NULL-terminated string.
Default value:
NULL (disabled)

...

  •  

...

...

...

...

pSetting

...

NULL-terminated string.
Default value:
NULL (disabled)

 

...

eOption

...

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled) 1 (enabled)
Default value:
0 (disabled)

 

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled) 1 (enabled)
Default value:
1 (enabled)

 

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled) 1 (enabled)
Default value:
1 (enabled)

 

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled—trial licenses are not available)1 - 60 (number of days a trial license will be available)
Default value:
0 (disabled)

 

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
-1 (disabled)1 - unlimited (number of times a trial license may be checked out)
Default value:
-1 (disabled)

 

...

eOption

...

...

...

pSetting

...

Possible values:
An integer, as follows:
0 (disallow) 1 (allow)
Default value:
0 (disallowed)

 

...

eOption

...

...

pSetting

...

Possible values:
An integer, as follows:
0 (disallow) 1 (allow)
Default value:
0 (disallowed)

 

...

eOption

...

...

...

pSetting

...

Possible values:
An integer, as follows:
-1 (Ignore failed heartbeat attempts. With this setting, your application will not shut down even if the license server goes down infinitely after a checkout. This setting is useful for a lenient license model. New instances of your application will not be able to start, but existing sessions will continue to run.)
0 (Disabled. The client should perform manual heartbeats instead using LMX_Heartbeat() to keep the license. See LMX_Heartbeat for information about the LMX_Heartbeat function.)
>0 (Shut down the application if no heartbeat response is received after the specified number of consecutive attempts. Once a valid heartbeat response is received, the internal counter will reset.)
Default value:
0 (disabled)

 

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
30 - 900 (seconds)
Default value:
120 (seconds)

 

...

eOption

...

pSetting

...

NULL-terminated string.
Default value:
NULL (Custom sharing not enabled)

 

...

eOption

...

pSetting

...

NULL-terminated string.
Default value:
NULL (disabled)

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled) 1 (enabled)
Default value:
0 (disabled)

 

...

eOption

...

pSetting

...

NULL-terminated string.
Default value:
NULL (disabled)

 

...

eOption

...

pSetting

...

NULL-terminated string.
Default value:
NULL (disabled)

 

...

eOption

...

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled) 1 (enabled)
Default value:
0 (disabled)

 

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled) 1 (enabled)
Default value:
1 (enabled)

 

...

eOption

...

pSetting

...

Possible values:
An integer, as follows:
0 (disabled) >0 (seconds)
Default value:
120 (seconds)

 

...

eOption

...

pSetting

...

NULL-terminated string.
Default value:
NULL (disabled)

 

...

eOption

...

pSetting

...

NULL-terminated string.
Default value:
NULL (disabled)

 

...

eOption

...

pSetting

...

Enum value of type LMX_HOSTID_TYPE.
Default value:
LMX_HOSTID_ALL

 

...

eOption

...

pSetting

...

Enum value of type LMX_HOSTID_TYPE.
Default value:
None. By default, all HostID types are enabled.

 

Return values

On success, this function returns the status code LMX_SUCCESS.

On failure, this function returns an error code in the format described in Return SOAP API return codes.

Remarks

Note that some of the flags are used in combination with checkout requests. This enables you to set flags for single checkout requests if needed.

Example For example:

The following example shows the use of LMX_SetOption by activating and deactivating LMX_OPT_EXACT_VERSION.

Code Block
languagecpp
#include <lmx.h>
#include <stdio.h>

LMX_HANDLE h;

int main() 
{
  exit_on_error(LMX_Init(&h));
  /* First checkout request requires an exact version match to pass */

...


  exit_on_error(LMX_SetOption(

...

h, LMX_OPT_EXACT_VERSION, (LMX_OPTION) 1)

...

);
  exit_on_error(LMX_Checkout(

...

h, "f2", 1, 0, 1));
  
  /* Second checkout request does not require an exact version match to pass 
  

...

  

...

and can 

...

request a version up 

...

to 

...

the 

...

one 

...

specified 

...

in 

...

the 

...

.lic 

...

file */

...


  exit_on_error(LMX_SetOption(

...

h, LMX_OPT_EXACT_VERSION, (LMX_OPTION) 0));

...


  exit_on_error(LMX_Checkout(

...

h, "f2", 0, 5, 1));

  return 0;
}