nrac_resource_consumer_add()

Abstract

Associate a consumer and a resource. The consumer becomes a user of the resource.

Syntax

nrac_resource_consumer_add (resource_handle, consumer_handle, event_handle)
Argument Type Description
resource_handle Nrac_Resource_Handle handle for the resource that will be used by the consumer
consumer_handle Nrac_Consumer_Handle handle for the consumer that will use the resource
event_handle Nrac_Event_Handle handle for a conditionalizing event. Use NRAC_ANY_EVENT to indicate unconditional use of the resource.

Return Type

Compcode

failure occurs only if this new binding is redundant with previously created ones, or due to insufficient memory resources

nrac.h

Details

Each consumer can use multiple resources and each resource can in turn be used by multiple consumers. Any enforcement of limitations on these associations (e.g., to prevent overloading of resources) is strictly determined by the application and not by the NRAC package. Thus, this call will succeed, except if a redundant association is attempted.

The binding between the consumer and the resource can be made contingent upon a specific event. The event must have been created at some prior point using nrac_event_create(). The event is used to separate different consumers which use the resource under different circumstances. Thus, a resource may support many consumers, but still not be “overloaded” since those consumers would not necessarily use the resource simultaneously. To specify that the consumer uses the resource no matter what, pass the special event handle NRAC_ANY_EVENT for the event argument. A single resource can support a mix of conditional and unconditional consumers.

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com