CmCheckEvents
Description
CmCheckEvents() waits until one of the set event flags occurs and returns the received event. This function should only be used in an own thread because it blocks an application until one of the checked events occurs.
This function/method is implemented locally in the CodeMeter library (dll). Only events concerning the locally connected CmContainer or the locally started CodeMeter License Server can be checked. The events are triggered by CodeMeter (for Mac and Linux this functionality is available since CodeMeter Version 4.10).
|
Triple Mode Redundancy-related information (TMR)
|
Syntax
unsigned long CMAPIENTRY CmCheckEvents(CMULONG flEvents)
Parameter
flEvents contains the flags of the events requested to be checked during a the call of the function. The following event flags can be set:
|
Please note that in some cases, operations can cover several events. For example, the import of a LIF file for Universal CmActLicenses covers three successive events: BOXADDED, ENTRYMODIFIED, ENTRYMODIFIED. |
CM_CE_BOXADDED (0x0004) checks, if a CmContainer is plugged in to the local computer.
CM_CE_BOXDISABLED (0x0400) checks, if a CmContainer is currently disabled.
CM_CE_BOXENABLED (0x0200) checks, if a CmContainer is currently enabled.
CM_CE_BOXREMOVED (0x0001) checks, if a CmContainer is removed from the local computer.
CM_CE_BOXREPLACED (0x0002) not implemented yet.
CM_CE_ENTRYMODIFIED (0x0020) checks, if a CmContainer entry is added, updated or deleted in a connected CmContainer.
CM_CE_ENTRYALTERED (0x0800) checks, if the following data of CmContainer changed:
•decrement of Unit Counter by encryption
•activation of Usage Period by encryption
•change of Certified Time
CM_CE_NETWORKLOST (0x0008) not implemented yet.
CM_CE_NETWORKPEPLACED (0x0010) not implemented yet.
CM_CE_RELEASE_EVENT (0x800000) releases all previously by this process opened CmCheckEvents calls.
|
In connection with Release_Event other events are ignored. If this would not be done,CmCheckEvents would be restarted immediately and could lead to high CPU load. |
CM_CE_SERVER_TERMINATED (0x0100) checks, if the CodeMeter License Server was terminated.
CM_CE_THRESHOLD_EXPDATE (0x0080) checks, if an Expiration Date will expire soon. Threshold is 5 days.
CM_CE_THRESHOLD_UNITCOUNTER (0x0040) checks, if a Unit Counter has crossed a limit and will reach 0 in one of the following operations. Threshold is 10 units.
Return
If one of the flags described is triggered, the occurred event is returned. If an error occurred, 0 is returned.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 4.30:
•CM_CE_ENTRYALTERED
|
Wibu-Systems recommends that CmCheckEvents() should not be triggered more than three times per event type from the protected application. Otherwise, performance may be impaired, since each event is checked to see whether it has already been notified. |
Syntax
public CmCheckEventsOption CmCheckEvents(CmGetBoxContentsOption Events)
|
Parameter
CmCheckEventsOption contains the flags of the events requested to be checked during a the call of the function. The following event flags can be set:
BoxRemoved checks, if a CmContainer is removed from the local computer.
BoxReplaced not implemented yet.
BoxAdded checks, if a CmContainer is plugged in to the local computer.
NetworkLost checks, if the network connection was lost.
NetworkReplaced not implemented yet.
EntryModified checks, if a CmContainer entry is added, updated or deleted in a connected CmContainer.
ThresholdUnitCounter checks, if a Unit Counter has crossed a limit and will reach 0 in one of the following operations. Threshold is 10 units.
ThresholdExpirationTime checks, if an Expiration Date will expire soon. Threshold is 5 days.
ServerTerminated checks, if the CodeMeter License Server was terminated.
BoxDisabled checks, if a CmContainer is currently disabled.
BoxEnabled checks, if a CmContainer is currently enabled.
EntryAltered checks, if the following data of CmContainer changed:
•decrement of Unit Counter by encryption
•activation of Usage Period by encryption
•change of Certified Time
ReleaseEvent releases all previously by this process opened CmCheckEvents calls.
|
In connection with ReleaseEvent other events are ignored. If this would not be done,CmCheckEvents would be restarted immediately and could lead to high CPU load. |
Return
If one of the flags described is triggered, the occurred event is returned. If an error occurred, 0 is returned.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 4.30:
•EntryAltered
Syntax
import cmapi
cmapi.CodeMeter().CmCheckEvents(flEvents: int) -> int
throws CodeMeterApiFailedException()
Parameter
flEvents contains the flags of the events requested to be checked during a the call of the function. The following event flags can be set:
|
Please note that in some cases, operations can cover several events. For example, the import of a LIF file for Universal CmActLicenses covers three successive events: BOXADDED, ENTRYMODIFIED, ENTRYMODIFIED. |
cmapi.CM_CE_BOXADDED (0x0004) checks, if a CmContainer is plugged in to the local computer.
cmapi.CM_CE_BOXDISABLED (0x0400) checks, if a CmContainer is currently disabled.
cmapi.CM_CE_BOXENABLED (0x0200) checks, if a CmContainer is currently enabled.
cmapi.CM_CE_BOXREMOVED (0x0001) checks, if a CmContainer is removed from the local computer.
cmapi.CM_CE_BOXREPLACED (0x0002) not implemented yet.
cmapi.CM_CE_ENTRYMODIFIED (0x0020) checks, if a CmContainer entry is added, updated or deleted in a connected CmContainer.
cmapi.CM_CE_ENTRYALTERED (0x0800) checks, if the following data of CmContainer changed:
•decrement of Unit Counter by encryption
•activation of Usage Period by encryption
•change of Certified Time
cmapi.CM_CE_NETWORKLOST (0x0008) not implemented yet.
cmapi.CM_CE_NETWORKPEPLACED (0x0010) not implemented yet.
cmapi.CM_CE_RELEASE_EVENT (0x800000) releases all previously by this process opened CmCheckEvents calls.
|
In connection with Release_Event other events are ignored. If this would not be done,CmCheckEvents would be restarted immediately and could lead to high CPU load. |
cmapi.CM_CE_SERVER_TERMINATED (0x0100) checks, if the CodeMeter License Server was terminated.
cmapi.CM_CE_THRESHOLD_EXPDATE (0x0080) checks, if an Expiration Date will expire soon. Threshold is 5 days.
cmapi.CM_CE_THRESHOLD_UNITCOUNTER (0x0040) checks, if a Unit Counter has crossed a limit and will reach 0 in one of the following operations. Threshold is 10 units.
Return
If one of the flags described is triggered, the occurred event is returned. If an error occurred, 0 is returned.
The following flags (and the corresponding functionality) are only available since CodeMeter Version 4.30:
•cmapi.CM_CE_ENTRYALTERED