UDP Reflector


Introduction            You may often need a data reflector. This class will accept incoming UDP and multicast packets and broadcast them to all connected clients.


QUANTA classes used

    QUANTAnet_udpReflector_c

                The setIncomingPort() sets the port for the reflector to listen on. In this demo it has been set to 6000. you can use setMulticastAddress() to listen on a multicast address and port. The process() when called in a while loop will continuously do its processing. If you want performance monitoring for the UDP socket, turn it on with enableInstrumentation() and then use the performance monitoring methods .

                The reflector.cxx program creates a reflector which accepts UDP packets. The performance monitoring is turned on and 


Usage

 1. To run the reflector, (say on evans)
              reflector port_number
         (port_number = 6000 default)

 2. To run the udp client ( in the ../udp directory)
              newclient evans
     Run two clients.

Output

          The reflector will show net statistics every 10 sec. Each time a new client connects is run, the reflector displays a message on the screen. When there are two clients running, you can see that the message from client1 is being reflected to client2 and vice versa.

for more information: Post your questions online on the Quanta forum page.