Writing Monitors for the Event Monitoring Service (December 1999)

124 Chapter3
Creating a Resource Monitor
Processing an Unregister Event
case RM_MONITOR_REQUEST_EVENT:
send_monitor_reply(obj);
break;
case RM_RESOURCE_UPDATE_EVENT:
update_resource(obj);
break;
case RM_SELECT_EVENT:
/***********************************************************************/
/* Since we do not set the select_data, we will not get this event. */
/***********************************************************************/
break;
case RM_TERMINATE_EVENT:
terminate();
break;
case RM_TIMEOUT_EVENT:
/***********************************************************************/
/* Since we do not set select_data.timeout, we will not get this event.*/
/***********************************************************************/
break;
case RM_UNREGISTER_EVENT:
/***********************************************************************/
/* For this event, we need to destroy the object. If the monitor */
/* keeps track of resource instances with active monitor requests, */
/* check lifetime option for preview unregister. In this case, */
/* request does not get unregistered. */
/***********************************************************************/
break;
default:
/***********************************************************************/
/* Ignore other events */
/***********************************************************************/
break;
}
rm_destroy(obj);
}
return;
}