Open topic with navigation
WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
int WINAPI win_lm_logout(char *producer, char *application, int seat, int token, int *syserr)
The producer code for your company, provided by Synergex. This is a null‑terminated 8‑bit ANSI string. (This code was assigned to your company by Synergex when you requested the License Key Generator.)
The code that you created to refer to the application. This is a null‑terminated 8‑bit ANSI string and can be up to six characters long.
An int32 set to the value that was passed in the seat argument to win_lm_login.
The token obtained from the win_lm_login call and used here to log out.
An int32 pointer returned with a system error code if the call fails.
The win_lm_logout function is used only when you have called win_lm_login with check set to 0 or 3 and the returned token was non‑zero.
The win_lm_logout function doesn’t log out a process in the usual sense (that is, it does not prevent the application from continuing). Instead it requests that License Manager release the “slot” for the specified license so that another user can log in and use the available slot.
If the token returned by the call to win_lm_login is non‑zero, it should be saved by your application and passed to win_lm_logout. The token ensures that the process that is logging out is authorized to do so.
If you passed a non‑zero value for seat in the call to win_lm_login, pass the same value for seat in the call to win_lm_logout. The seat, in combination with the token, ensures that the correct license is logged out in a server environment. If you pass seat with win_lm_login and fail to pass the same seat value with win_lm_logout, the results could be unpredictable.
You must call win_lm_logout as part of your exit procedure. If you do not, the license will remain in use until the license server logs it out, which could take as long as 20 minutes. For another way to release licenses see win_lm_cleanup.
The win_lm_logout function returns a status value. The most common ones are listed below; see the Licensing Toolkit Error Codes table for additional codes that could be returned.
0 = Success
3 = Invalid tken
These status values are for your information only; they have no effect on your application. You must write code to handle the returned status.
See lmdltest.c in Licensing_TK_Examples.zip, available from Synergy CodeExchange in the Resource Center on the Synergex website.