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

...

language

...

cpp
LMX_STATUS LMX_SetOption

...


(
   LMX_HANDLE LmxHandle,

...


   LMX_SETTINGS eOption,

...


   const void *pSetting

...


);

...

...

Parameters

LmxHandle
[in/out] LM-X handle.

eOption
See the table of LMX_SetOption Options and Settings the eOption information for the specific option, listed below.

pSetting
See the table of LMX_SetOption Options and Settings 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 following table describes the eOption and pSetting parameter values for LMX_SetOption , including:functions

The functions for LMX_SetOption are listed below.  

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

Unless otherwise specified, the options in the following table affect the checkout requests.

...

LMX_SetOption Function eOption and pSetting Parameter Values

...

 

...

eOption

...

...

...

pSetting

...

...

 

...

eOption

...

...

...

pSetting

...

Function pointer value.
Default value:
NULL (disabled)
Prototype:
void (LMX_CALLBACK *HeartbeatCheckoutFailure_pfn)
(
void pVendorData, / Vendor-specified data */
const char szFeatureName, / Name of lost feature */
int nUsedLicCount, /* Number of licenses lost */
LMX_STATUS LmxStat /* Error code that indicates why they were lost */
);

 

...

eOption

...

...

...

...

...

pSetting

...

Function pointer value.Default value: NULL (disabled)Prototype:void (LMX_CALLBACK *HeartbeatRetryFeature_pfn)(
void pVendorData, / Vendor-specified data /const char *szFeatureName, / Name of feature about to be checked out /int nUsedLicCount / Number of licenses to checkout */);

 

...

eOption

...

...

...

...

...

...

...

...

...

 

...

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*/
);

...

...

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)

...

  •  

...

eOption

...

...

...

pSetting

...

...

 

...

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

...

...

 

...

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

...

Return values

...

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.

 

...

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.
For example:
/* First checkout request requires an exact version match to pass */
LMX_SetOption(...,

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;
}