Log out a previously logged in license

WTSupported in traditional Synergy on Windows
WNSupported in Synergy .NET on Windows
USupported on UNIX


xcall lm_logout(lo_stat, producer, application, token[, seat])



Returned with the log‑out status. The most common ones are listed below; see the Licensing Toolkit Error Codes table for additional codes that could be returned. (n)

0 = Success.

3 = Invalid token.


The producer code for your company. (This code was assigned to your company by Synergex when you requested the License Key Generator.) (a)


The code that you created to refer to the application. (a)


The token obtained from the LM_LOGIN call and used here to log out. (i4)


(optional) A 32‑bit integer set to the value that was passed in the seat argument to the LM_LOGIN call. (i)


LM_LOGOUT is used only when you have called LM_LOGIN with check set to 0 or 3 (or not passed) and the returned token was non‑zero.

The LM_LOGOUT subroutine doesn’t log out a process in the usual sense (that is, it does not prevent the application from continuing); rather, 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 LM_LOGIN is non‑zero, it should be saved by your application and passed to 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 LM_LOGIN, pass the same value for seat in the call to 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 LM_LOGIN and fail to pass the same seat value with LM_LOGOUT, the results could be unpredictable.

On Windows, you must call LM_LOGOUT as part of your exit procedure, or the license will stay in use until the license server logs it out; this could take as long as 20 minutes. You should also call LM_LOGOUT in case of an application error.

On UNIX, although LM_LOGOUT is not required (normally licenses are logged out automatically when the runtime process has terminated), we recommend that you call LM_LOGOUT as part of your normal exit procedure, especially if your application STOP chains to another program. You should also call LM_LOGOUT in case of an application error.

The status values returned by LM_LOGOUT are for your information only; they have no effect on your application. You should write code to handle the returned status. You can access system error codes with %SYSERR, which may assist in troubleshooting.