4.2 Registering for Notifications with INtmsSession1

The following example illustrates how the RSM client uses the INtmsSession1 interface to register with an RSM server for receiving notifications of changes in the storage objects.

Example of notification registration

Figure 2: Example of notification registration

  1. The client calls INtmsSession1::OpenNtmsServerSessionA to open a session with the server.

  2. The server initializes the session and indicates success.

  3. The RSM client calls INtmsSession1::AddNotification. The dwType parameter is set to a value from the NtmsObjectsTypes enumeration.

  4. Whenever there is a change in the storage object, the server sends notification to all the clients who are registered with the server for that particular object type. The server sends notification by calling the clients' NtmsNotifySink::OnNotify method.

  5. When a client wants to deregister for a particular storage object type, the client calls INtmsSession1::RemoveNotification.