3 Real-Time Event Service
6 File: DevGuideExamples/EventServices/RTEC_MCast_Federated/README
9 This directory contains an example that shows how to create and
10 federate real-time event channels using the classes in EC_Gateway_UDP.h.
11 Depending on the options, it will use either UDP or multicast to link
14 -------------------------------------------------------------------------
16 Note: To run this example, you must first run the Naming Service, e.g.:
18 $TAO_ROOT/orbsvcs/Naming_Service/Naming_Service -o ns.ior&
20 -------------------------------------------------------------------------
22 To start the supplier/EC processes on a single host and federate them
23 using UDP, do the following (after starting the Naming_Service):
25 ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name1 -port 1233 -listenport 1234
26 ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name2 -port 1234 -listenport 1233
28 This will start two EC/supplier processes on the same node. One (name1)
29 will listen on port 1234 and send on port 1233. The other (name2) will
30 do the opposite. You should be able to use any available port as long as
31 the port and listenport options are symmetric (listenport of one process
32 must be the port of the other). The -address option can be used to
33 specify a supplier/EC process on another host. Here is an example of two
34 processes on different hosts:
37 ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name1 -port 1233 -listenport 1234 -address node2
39 ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -udp -ecname name2 -port 1234 -listenport 1233 -address node1
41 When using UDP, this example is limited to federating two ECs.
43 -------------------------------------------------------------------------
45 To start the supplier/EC processes and federate them using multicast, do the
46 following (after starting the Naming_Service):
48 ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -ORBSvcConf supplier.conf -ecname name1 -address 224.9.9.2 -port 1234
49 ./EchoEventSupplier -ORBInitRef NameService=file://ns.ior -ORBSvcConf supplier.conf -ecname name2 -address 224.9.9.2 -port 1234
51 The -address and -port options should be passed a valid and available
52 multicast address and port.
54 -------------------------------------------------------------------------
56 To start the consumers, simply do the following (this works the same for
57 both types of federations):
59 ./EchoEventConsumer -ORBInitRef NameService=file://ns.ior -ecname name1
60 ./EchoEventConsumer -ORBInitRef NameService=file://ns.ior -ecname name2
62 It may be easiest to start these in separate windows. Each consumer
63 connects to one EC (specified by the -ecname option). You should see
64 events from both suppliers on each event channel (each supplier passes
65 events containing with the name of the EC they are using).
67 -------------------------------------------------------------------------
69 EchoEventSupplerMain.cpp
71 Main program for a PushSupplier.
73 EchoEventSupplier [ -ORBSvcConf supplier.conf ] [ -udp ] -ecname <name>
74 [ -address <address> ] [ -port <port> ]
75 [ -listenport <lport> ]
77 This will create a local RTEC event channel and bind it under
78 the root context of the naming service with the name <name>.
79 It will also federate with remote event channels specified via
80 the other options. By default, it uses multicast to federate
81 the ECs (specifying -udp forces use of UDP). <address> is
82 the address of the remote EC when using UDP and the multicast
83 address when using multicast. <port> is the port to send
84 to when using UDP and the multicast port when using multicast.
85 <lport> is the port to listen on for UDP (and not used by
86 multicast. You must pass -ORBSvcConf supplier.conf when
87 using multicast so as to enable Observers.
89 After initializing the local event channel and setting up the
90 connection for the federation, it publishes an event to the
91 local event channel every 10 milliseconds. This event will
92 contain the string <name> in the any_value field.
94 Use Control-C to kill the process.
96 -------------------------------------------------------------------------
98 EchoEventConsumerMain.cpp
100 Main program for a PushConsumer.
104 EchoEventConsumer -ecname <name>
106 This will look for an event channel bound to <name> in the Root context
107 of the Naming Service. It will consume events from this channel and
108 print the type, source, and string contents contained in any_value.
110 Use Control-C to kill the process.
112 -------------------------------------------------------------------------
114 EchoEventConsumer_i.{h,cpp}
116 Call which implements the RtecEventComm::PushConsumer interface.
118 -------------------------------------------------------------------------
120 SimpleAddressServer.{h,cpp}
122 This is a servant class that implements the RtecUDPAdmin::AddrServer
123 interface. It is used by the UDP/multicast senders to return an
124 address that they will send out particular events on. It is also
125 used by the multicast event handler, to determine which addresses
126 to listen to based on consumer subscriptions. This simple
127 implementation always returns the same address.
131 Exeuction via Perl Script
132 -------------------------
134 A Perl script has been created to automate the steps shown
135 above. This script can be run via the following command:
139 By default, this script uses multicast; pass -udp to the