Notification across task boundaries

Up to this point, all discussions have been related to notifications within one task. This section shows how to send and receive notifications across task boundaries.

The Notification framework provides two classes, MRemoteCallerNotifier and MRemoteDispatcherNotifier, that support notification across tasks. These classes must be mixed in with other communications classes in order to work properly. MRemoteCallerNotifier must be mixed in with MRemoteCaller or its derived classes, and MRemoteDispatcherNotifier must be mixed in with MRemoteDispatcher or its derived classes. This allows the caller to connect to and receive notification from a remote dispatcher, and allows the dispatcher to accept connections from and send notifications to remote callers.

For a server that must notify clients of changes in the server state, the simplest approach is to mix MRemoteCallerNotifier in with the caller and MRemoteDispatcherNotifier in with the server dispatcher.

To use MRemoteCallerNotifier, you only need to mix it in with MRemoteCaller. However, to use MRemoteDispatcherNotifier, you must also write boilerplate code in your dispatcher to delegate the notification specific requests to the MRemoteDispatcherNotifier.

MRemoteNotifierCaller supports the standard notifier protocol and automatically connects to the server for notification when connections are made to the client. IPC is minimized by only connecting to the remote dispatcher the first time an interest in it is registered and disconnecting only when the last connection is removed. The MRemoteDispatcherNotifier class takes care of all IPC necessary to inform the MRemoteNotifierCallers of a notification from the dispatcher team. The dispatcher only notifies callers that actually have connections for the specific notification.


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

Generated with WebMaker