1 // Reused from: $TAO_ROOT/orbsvcs/examples/RtEC/MCast
4 #include "orbsvcs/RtecEventChannelAdminS.h"
5 #include "orbsvcs/Event_Service_Constants.h"
12 Supplier::connect (RtecEventChannelAdmin::SupplierAdmin_ptr supplier_admin
)
15 supplier_admin
->obtain_push_consumer ();
17 RtecEventComm::PushSupplier_var me
=
20 // Simple publication, but usually the helper classes in
21 // $TAO_ROOT/orbsvcs/Event_Utils.h are a better way to do this.
22 RtecEventChannelAdmin::SupplierQOS qos
;
25 qos
.publications
.length (1);
26 RtecEventComm::EventHeader
& h0
=
27 qos
.publications
[0].event
.header
;
28 h0
.type
= ACE_ES_EVENT_UNDEFINED
; // first free event type
29 h0
.source
= 1; // first free event source
31 this->proxy_
->connect_push_supplier (me
.in (), qos
);
35 Supplier::disconnect ()
37 // Disconnect from the EC
40 this->proxy_
->disconnect_push_consumer ();
42 catch (const CORBA::Exception
&)
46 PortableServer::POA_var poa
=
47 this->_default_POA ();
48 PortableServer::ObjectId_var id
=
49 poa
->servant_to_id (this);
50 poa
->deactivate_object (id
.in ());
54 Supplier::perform_push ()
58 // The event type and source must match our publications
59 RtecEventComm::EventSet
event (1);
61 event
[0].header
.type
= ACE_ES_EVENT_UNDEFINED
;
62 event
[0].header
.source
= 1;
63 // Avoid loops throught the event channel federations
64 event
[0].header
.ttl
= 1;
66 this->proxy_
->push (event
);
68 catch (const CORBA::Exception
&)
74 Supplier::disconnect_push_supplier ()