class CAVERNplus_udpReflector_c : public CAVERNplus_socketbase_c

UDP and Multicast Reflector class

Inheritance:


Public Methods

int init ()
Initialize the reflector once all the parameters are set up
int process ()
Call this within a while loop to let the reflector continuously do its processing
void setForcedDestination (char *ipAddr, unsigned short port)
Set a single ip address and port number to which all packets will be sent.
void setIncomingPort (unsigned short port = 6000)
Set the incoming port for the reflector to listen on
void setMulticastAddress (char *ipAddr, unsigned short port)
Set up to also listen on a multicast address and port
void setMulticastTTL (int ttl)
Set multicast TTL to something other than the default at 160
void setTimeOutTime (int secs)
Set the time out time when connected clients who have not sent any data for a while will be removed

Inherited from CAVERNplus_socketbase_c:

Public Methods

void expandHostName(char *src, char *newname, int len)
double getAverageReceiveBandwidth()
double getAverageSendBandwidth()
void getHostName(char *name, int len)
double getInstantReceiveBandwidth()
double getInstantSendBandwidth()
double getTimeInSecs()
unsigned long getTotalDataReceived()
unsigned long getTotalDataSent()
int hostnameToIP(char *hostname, char* hostIP)
void ipNumToString(unsigned int ip, char *ipstring)
void showStats()

Documentation

UDP and Multicast Reflector class. Even though CAVERNsoft's key, link, and channel concept essentially acts as a data reflector there are instances where a generic packet reflector (to support legacy applications) are needed. This class fulfills that need.

This class will accept incoming UDP packets and broadcast them to all listeners. This class also accepts incoming multicast packets and broadcasts them to all listeners (whether they are on UDP or Multicast). In that case all incoming UDP packets will also be broadcasted to the Multicast group.

To add a listener to the reflector the remote client simply needs to send a packet to the reflector. The reflector will use the packet's address as the return address for future data. If a client does not send any data for a certain period of time that client is removed from the reflector's list of listeners.

int init()
Initialize the reflector once all the parameters are set up. If you need to change the settings at a later time you need to delete this object and create a new one with the new settings.

void setIncomingPort(unsigned short port = 6000)
Set the incoming port for the reflector to listen on. Default is set at 6000

void setTimeOutTime(int secs)
Set the time out time when connected clients who have not sent any data for a while will be removed. Default is set at 60 seconds.

void setMulticastAddress(char *ipAddr, unsigned short port)
Set up to also listen on a multicast address and port. This means that any incoming packets on the UDP connection will get broadcasted via this reflector to the multicast channel too.


This class has no child classes.

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de