VLSsetSharedId/ VLSsetTeamId
Syntax
In case of a normal license:
LS_STATUS_CODE VLSsetSharedId ( int
sharedId
, unsigned long (
*mySharedIdFunc
) (char * value) );
In case of a capacity license, you need to use the VLSsetTeamId macro which is a wrapper to the VLSsetSharedId API:
LS_STATUS_CODE VLSsetTeamId ( int
teamId
, unsigned long (
*mySharedIdFunc
) (char * value) );
Argument | Description |
sharedId/ teamId |
Must be one of the following values:
|
mySharedIdFunc |
Pointer to a function that fills the sharedID value into the value parameter. The return type of mySharedIdFunc is ignored. |
Description
Redefines the functions called to get the relevant sharing parameter of the client. For network use only.
VLSsetSharedId/VLSsetTeamId must be used to register a customized sharedID/teamID function with the licensing library. The value of the sharedID must be passed back by mySharedIdFunc through the character buffer. All sharedID character buffers will be truncated to 32 bytes. For instance, a customized function which returns the host name can be used by the licensing library instead of the built-in function to determine eligibility for sharing a license.
VLSsetSharedId should be used in case of normal license and VLSsetTeamId should be used in case of capacity license.
If the host name or user name are changed using this function, the change will also be reflected in the usage file written by the License Manager.
One of the many flexibility provided by LM licensing is the sharing of same license keys, based on the following criteria:
- User name-based sharing
- Host name-based sharing
- X display-based sharing
- Application-defined sharing
This model is often used by software publishers who do not want to count every instance of a running application. They may allow multiple instances of a running application to share a single license token-based on a common user name, host name or custom sharing criteria.
When any of the sharing-options are enabled in a license, the License Manager checks if the new request made by a client is coming from the same User/Host/X-display or not. If it is so, then it checks with the sharing-limit per license-key and then issues the same key to the new user.
Internally, the VLSrequestExt function, while sending a License Issue Request Message to the License Manager, passes on the information regarding its user-name, client-hostname, x-displayname to the License Manager. This information is kept by the License Manager in its internal tables for future use. The next time a license is requested for the same Feature, the saved information is used to determine whether this new request is originating from the same user/host/x-display.
By default, Sentinel RMS Development Kit has default functions to get these values (i.e. user name, x-display, etc.). To use your own functions to retrieve these values, use the VLSsetSharedId function to override the default functions.
NOTE For information related to reserved characters and strings while generating license codes, refer to the Sentinel RMS License Generation API Reference Guide.
Returns
The status code LS_SUCCESS is returned if successful. Otherwise, it will return the following error codes:
Error Code |
Description |
VLS_CALLING_ERROR |
mySharedIdFunc is NULL. |
VLS_UNKNOWN_SHARED_ID |
Invalid sharedId/ teamId; is either negative or exceeds maximum value. |
For a complete list of the error codes, see Licensing Library Error and Result Codes.