cookie 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).

tmr_02

Triple Mode Redundancy-related information (TMR)

  • C, C++
  • C#
  • Python

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:

information_weiss_klein26

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.

nav_open CM_CE_BOXADDED (0x0004) checks, if a CmContainer is plugged in to the local computer.

nav_open CM_CE_BOXDISABLED (0x0400) checks, if a CmContainer is currently disabled.

nav_open CM_CE_BOXENABLED (0x0200) checks, if a CmContainer is currently enabled.

nav_open CM_CE_BOXREMOVED (0x0001) checks, if a CmContainer is removed from the local computer.

nav_open CM_CE_BOXREPLACED (0x0002) not implemented yet.

nav_open CM_CE_ENTRYMODIFIED (0x0020) checks, if a CmContainer entry is added, updated or deleted in a connected CmContainer.

nav_open 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

nav_open CM_CE_NETWORKLOST (0x0008) not implemented yet.

nav_open CM_CE_NETWORKPEPLACED (0x0010) not implemented yet.

nav_open CM_CE_RELEASE_EVENT (0x800000) releases all previously by this process opened CmCheckEvents calls.

information_weiss_klein26

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.

nav_open CM_CE_SERVER_TERMINATED (0x0100) checks, if the CodeMeter License Server was terminated.

nav_open CM_CE_THRESHOLD_EXPDATE (0x0080) checks, if an Expiration Date will expire soon. Threshold is 5 days.

nav_open 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

information_weiss_klein26

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:

nav_open BoxRemoved checks, if a CmContainer is removed from the local computer.

nav_open BoxReplaced not implemented yet.

nav_open BoxAdded checks, if a CmContainer is plugged in to the local computer.

nav_open NetworkLost checks, if the network connection was lost.

nav_open NetworkReplaced not implemented yet.

nav_open EntryModified checks, if a CmContainer entry is added, updated or deleted in a connected CmContainer.

nav_open ThresholdUnitCounter checks, if a Unit Counter has crossed a limit and will reach 0 in one of the following operations. Threshold is 10 units.

nav_open ThresholdExpirationTime checks, if an Expiration Date will expire soon. Threshold is 5 days.

nav_open ServerTerminated checks, if the CodeMeter License Server was terminated.

nav_open BoxDisabled checks, if a CmContainer is currently disabled.

nav_open BoxEnabled checks, if a CmContainer is currently enabled.

nav_open 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

nav_open ReleaseEvent releases all previously by this process opened CmCheckEvents calls.

information_weiss_klein26

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:

information_weiss_klein26

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.

nav_open cmapi.CM_CE_BOXADDED (0x0004) checks, if a CmContainer is plugged in to the local computer.

nav_open cmapi.CM_CE_BOXDISABLED (0x0400) checks, if a CmContainer is currently disabled.

nav_open cmapi.CM_CE_BOXENABLED (0x0200) checks, if a CmContainer is currently enabled.

nav_open cmapi.CM_CE_BOXREMOVED (0x0001) checks, if a CmContainer is removed from the local computer.

nav_open cmapi.CM_CE_BOXREPLACED (0x0002) not implemented yet.

nav_open cmapi.CM_CE_ENTRYMODIFIED (0x0020) checks, if a CmContainer entry is added, updated or deleted in a connected CmContainer.

nav_open 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

nav_open cmapi.CM_CE_NETWORKLOST (0x0008) not implemented yet.

nav_open cmapi.CM_CE_NETWORKPEPLACED (0x0010) not implemented yet.

nav_open cmapi.CM_CE_RELEASE_EVENT (0x800000) releases all previously by this process opened CmCheckEvents calls.

information_weiss_klein26

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.

nav_open cmapi.CM_CE_SERVER_TERMINATED (0x0100) checks, if the CodeMeter License Server was terminated.

nav_open cmapi.CM_CE_THRESHOLD_EXPDATE (0x0080) checks, if an Expiration Date will expire soon. Threshold is 5 days.

nav_open 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