DLM Monitors

The C language version of the DLM monitor API is exported by dlmmon.h. Common types and structures are exported by dlmdef.h.

To start a monitor session:

  1. Call dlm_MonInitialize() once to initialize the monitor module.
  2. Call dlm_MonOpen() to allocate resources for the session and get a session id.
  3. Call dlm_MonConnect() to establish a connection with the server.

One of the parameters to dlm_MonOpen() is a callback function. Once a monitor session has successfully connected to the server, the callback function supplied by the application will be called for each event that arrives from the server. Events received in the callback must be released back to the monitor module by calling dlm_MonReleaseEvent().

To terminate a monitor session, call dlm_MonDisconnect(). When the session is no longer required:

  1. Call dlm_MonClose() to release resources associated with the session.
  2. Call dlm_MonUninitialize() after all sessions have been closed.

During a session, the data flow from the server can be stopped by calling dlm_MonStop() and restarted by calling dlm_MonStart(). However, be aware that data is not buffered by the server while a session is stopped.

The State Machine

Monitor-server communication is modeled using the finite state machine shown below.

DLM State Machine
The monitor state machine.

Transitions may be caused either by calling API functions or by events received from the server. The current state of a monitor session can be determined by calling dlm_MonState(). State codes can be converted to strings by calling dlm_StateMessage().