Data Structures | Macros | Typedefs | Functions
Licensing API

Data Structures

struct  AtLicenseInfo
 License info structure. More...
 

Macros

#define HOST_NAME_MAX   64
 

Typedefs

typedef struct AtLicenseInfo AtLicenseInfo
 License info structure.
 

Functions

AI_API bool AiLicenseSetServer (const char *host, unsigned int port)
 Set the name and port of the machine where the license server resides. More...
 
AI_API bool AiLicenseGetServer (char *host, unsigned int &port)
 Get the name and port of the machine where the license server resides. More...
 
AI_API void AiLicenseSetAttempts (int attempts)
 Set the maximum attempts of RLM error recoveries. More...
 
AI_API unsigned int AiLicenseGetAttempts ()
 Get the maximum attempts of RLM error recoveries. More...
 
AI_API void AiLicenseSetAttemptDelay (int msecs)
 Set the time delay (in milliseconds) between RLM error recoveries. More...
 
AI_API unsigned int AiLicenseGetAttemptDelay ()
 Get the time delay (in milliseconds) between RLM error recoveries. More...
 
AI_API int AiLicenseGetInfo (AtLicenseInfo *&licenses, unsigned int &n)
 Check the status of the license servers provided through the environment variables solidangle_LICENSE, RLM_LICENSE and ARNOLD_LICENSE_[HOST|PORT] and get information about all the installed licenses in those servers. More...
 

Error Codes

#define AI_LIC_SUCCESS   0
 no error
 
#define AI_LIC_ERROR_CANTCONNECT   1
 can't connect to any RLM server
 
#define AI_LIC_ERROR_INIT   2
 error on initialization
 
#define AI_LIC_ERROR_NOTFOUND   3
 no licenses found (expired or not loaded)
 
#define AI_LIC_ERROR_NOTAVAILABLE   4
 no licenses available (all in use)
 
#define AI_LIC_ERROR   -1
 generic license error
 

Detailed Description

Function Documentation

AI_API bool AiLicenseSetServer ( const char *  host,
unsigned int  port 
)

Set the name and port of the machine where the license server resides.

If host and/or port have non-zero values, this function will override the use of the environment variables ARNOLD_LICENSE_HOST and/or ARNOLD_LICENSE_PORT respectively. When using a zero value, this will unset the previously set host and/or port (if they were set).

The following code shows a usage example:

AiASSLoad("test.ass");
// Set the license server to "5063@intel"
AiLicenseSetServer("intel", 5063);
// Arnold will connect to the RLM server at "5063@intel"
// Unset the license server hostname and port
// Now Arnold will connect to the RLM server pointed to by the environment
// variables ARNOLD_LICENSE_HOST and ARNOLD_LICENSE_PORT. If they were
// not configured, Arnold will attempt to connect to the default server
// location at "5053@localhost"
Parameters
hostRLM server hostname. If NULL, the hostname is unset and ARNOLD_LICENSE_HOST or default hostname localhost will be used.
portRLM server port. If zero, the port is unset and ARNOLD_LICENSE_PORT or default 5053 port will be used.
Returns
true if success setting the server
See Also
AiLicenseGetServer
AI_API bool AiLicenseGetServer ( char *  host,
unsigned int &  port 
)

Get the name and port of the machine where the license server resides.

Parameters
[out]hostRLM server hostname.
[out]portRLM server port
Returns
true if success getting the server, false otherwise
See Also
AiLicenseSetServer
AI_API void AiLicenseSetAttempts ( int  attempts)

Set the maximum attempts of RLM error recoveries.

Parameters
attemptsNumber of maximum attempts. A zero or negative value will unset the current configured number of attempts.
AI_API unsigned int AiLicenseGetAttempts ( )

Get the maximum attempts of RLM error recoveries.

Returns
Number of maximum attempts.
AI_API void AiLicenseSetAttemptDelay ( int  msecs)

Set the time delay (in milliseconds) between RLM error recoveries.

Parameters
msecsThe time delay between retries (in milliseconds). A negative value will unset the current configured time delay.
AI_API unsigned int AiLicenseGetAttemptDelay ( )

Get the time delay (in milliseconds) between RLM error recoveries.

Returns
The time delay between retries (in milliseconds)
AI_API int AiLicenseGetInfo ( AtLicenseInfo *&  licenses,
unsigned int &  n 
)

Check the status of the license servers provided through the environment variables solidangle_LICENSE, RLM_LICENSE and ARNOLD_LICENSE_[HOST|PORT] and get information about all the installed licenses in those servers.

This function checks both the connections, the RLM services and the existence of free licenses in the servers. If nothing fails and there are available licenses, the function will return with AI_LIC_SUCCESS status and 'licenses' will return all Arnold usable licenses, otherwise it will return an error code.

Parameters
[out]licensesAll usable licenses held by the RLM license servers
[out]nnumber of elements returned in the licenses vector
Returns
AI_LIC_SUCCESS if successful, error code otherwise.

© 2009-2013 Solid Angle SL · all rights reserved · www.solidangle.com