Hasp.Login Method
Namespace: Aladdin.Hasp
Description
Logs into a Feature, which establishes a session context.
Syntax
HaspStatus Login ( Byte[] vendor_code )
Parameters
vendor_code
|
Bytes that contain the Vendor Code |
Return Values
A HaspStatus status code.
Usage Notes
This method establishes a context to a Sentinel protection key that contains a license for the requested Feature ID.
The Feature ID must first be specified using the Hasp constructor.
If the session is idle, the License Manager releases the session after 12 hours. (The timeout for the session is displayed in the Sessions page of Admin Control Center.) When one of the following methods is called, the session is refreshed and the timeout counter is reset to 12 hours: Login, Login (With Scope), Encrypt, Decrypt, GetSize, Read, Write, GetRealTimeClock.
If the Feature license expires while the login session is active, the login session (and therefore, the application) is allowed to continue. This is due to the fact that terminating the session may result in corruption of the application output or data.
The required Vendor Codes are stored in a VendorCodes folder in your system. Without the correct Vendor Code, the method call cannot succeed.
You can open simultaneous login sessions.
NOTE Important considerations:
>When the Login method is called for a Feature with a license type of Execution Count, Expiration Date, or Time Period, a write cycle is performed for the Sentinel protection key. Sentinel HL keys are certified to withstand a specific number of write cycles. For information on the number of write cycles for which Sentinel HL keys are certified, see the Sentinel HL Data Sheet.
>The V-Clock time is not automatically updated by the License Manager if you are using only Sentinel Licensing API to protect your application. To update the V-Clock time for a given protection key with Sentinel Licensing API, you must establish a session for the key (using the
For more information on V-Clock, see the
If detaching of licenses is enabled, an automatic detach occurs when the Login method is called.
You can perform an on-demand detach by calling the Transfer method. For details, see Detaching an SL AdminMode or SL UserMode License.
High-Availability Client Redirection and Failover
In high-availability configurations, client applications call hasp_login() or hasp_login_scope() to consume network seats. When configured with the hostnames or IP addresses of the participating License Managers in the client configuration file (hasp_<vendorID>.ini or hasplm.ini), the client API automatically negotiates connection with the current leader License Manager.
>Automatic Failover: If the active leader fails, subsequent API calls or new login requests automatically discover and reconnect to the newly elected leader without requiring client application restarts.
>Automatic Retries: If a login call occurs during an active leader election, the client API automatically retries the operation until leader election resolves or the operation times out.
>Quorum Not Met: If fewer than two License Managers are reachable, the API returns status code 117 (HASP_HA_QUORUM_NOT_MET). License consumption remains suspended until the quorum is re-established.
Overloaded Methods
The following overloaded methods are provided. They differ from the method above only in the arguments that they accept.
HaspStatus Login ( String vendor_code )
