Multiple Interests

Multiple Interests is a sample program that extends TSender to add additional protocol and interests, and extends TReceiver to use separate handlers for each interest.

Running the sample

Execute MultipleInterestsSApp. As the notifications are sent and received, the different handlers of TReceiver prints different messages to the shell window.

Files and classes

TSender is defined in Sender.h and Sender.C. It is similar to TSender in BasicNotification, except that it 1) declares additional member functions for the new interests, and 2) notifies using different interests when it undergoes different changes.

TReceiver is defined in Receiver.h and Receiver.C. It is similar to TReceiver in BasicNotification, except that it no longer specifies a default member function for the connection to dispatch notifications to. Instead, it specifies a separate member function for each interest.

Notes

The convenience of having the connection dispatch notifications to separate member functions entails some additional overhead in the connection object.


Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.