Make your own free website on Tripod.com
// C++
#include <CosEvent.h>
...
int main() {
        CORBA::String_var eventChannelName = "//otrmp/clock";
        int i;
        ...
        try {
   // Initialize
   ....
                // Obtain a reference to an event channel:
                CosEventChannelAdmin::EventChannel  channel =
      CosEventChannelAdmin::EventChannel::
    _bind(eventChannelName, 0);

                // Obtain a supplier administration object:
                CosEventChannelAdmin::SupplierAdmin
     supplierAdmin =   channel->for_suppliers();

                // Obtain a proxy push consumer:
                CosEventChannelAdmin::ProxyPushConsumer
                        proxyPushConsumer =
                         supplierAdmin->obtain_push_consumer();

                // Omit optional step to connect push supplier to
                // proxy push consumer in this example.
                ...
                for (i=0; i<50; i++) {
                        ... // Code to obtain time of day not shown.
                        CORBA::Any a;
                        a <<= ... // A string containing current time.

                        // Push data into the event channel (which is acting
                        // as a push consumer):
                        proxyPushConsumer->push(a);
                        CORBA::App.processEvents(1000);
                }
        } catch (CORBA::Exception& e)
                        ... // Handle exceptions here.
        ...
} // End main()