In addition to polling the connection for incoming messages using RCM_GetPendingMessage function (see rcm_exchange), the RCM library provides alternative mechanism for receiving messages. It is called Message filtering.
The idea is that the user provides and installs in the connection a filter that includes a filtering function. This function is run against every received message. The filtering function can capture the message data and decide whether the message is already processed (it then returns true) or not (returns false).
The filters are installed in a chain. A received message passes this chain until one of the filters catches it. In case no filter catches the message, it is being stored in the message buffer and will be available through the RCM_GetPendingMessage function.
The following example illustrates the usage of message filtering:
Often, the filter will be designed in such a way, that will filter out messages comming through a given endpoint. Fot that purposes a special kind of filter is already provided by the RCM library.
The Endpoint message filter filters messages received through a given endpoint and stores them in it's own message buffer. In order to use the endpoint message filter, the user must first initialize it using RCM_InitEndpointMessageFilter and then install it in the connection using RCM_InsertMessageFilterInBack or RCM_InsertMessageFilterInFront. Once the filter is in place, the user can call RCM_GetMessageFromEndpointMessageFilter to check if new messages were received. This function has also the ability to block the calling thread until message arrives or timeout is reached. The received messages need to be deleted by the user, by calling RCM_UnlockEndpointMessage. An unused endpoint message filter should be deinitialized using RCM_DeinitEndpointMessageFilter.
The following example illustrates the usage of endpoint message filter:
Generated on Fri Aug 31 2018 09:37:14 for RCM API Library by 1.8.7