class CAVERNnet_udpReflector_c : public CAVERNnet_socketbase_c UDP and Multicast Reflector class
| | init () Initialize the reflector once all the parameters are set up |
| | setIncomingPort (unsigned short port = 6000) Set the incoming port for the reflector to listen on |
| | setTimeOutTime (int secs) Set the time out time when connected clients who have not sent any data for a while will be removed |
|
| setForcedDestination (char *ipAddr, unsigned short port) Set a single ip address and port number to which all packets will be sent. |
| | setMulticastAddress (char *ipAddr, unsigned short port) Set up to also listen on a multicast address and port |
|
| setMulticastTTL (int ttl) Set multicast TTL to something other than the default at 160 |
| | process () Call this within a while loop to let the reflector continuously do its processing |
| | intercept (int (*callback) (CAVERNnet_udp_c *client, char** buffer, int *bufferSize, void *userData), void* userData) Intercept incoming messages and call a user-defined callback function |
|
| enableInstrumentation () Enable instrumentation - this is for turning on the performance monitoring for the UDPsocket used -instrumentation for the udp sockets are turned off by default - and it should be explicitly enabled for latency, jitter and related statistics |
|
| disableInstrumentation () Disable instrumentation - this is for turning off the performance monitoring for the UDPsocket used |
| | showStats (char* streamInfo, char* comment) Displays the resultant statistics instantaneously in the netlogger format - this should be typically done after a read/write is done a network |
| | logStats (char* streamInfo, char* comment, FILE* filePtr) This logs performance statistics in a file |
| | sendStats (char* streamInfo, char* comment) Sends the performance statistics to a remote perfdaemon -for further analysis of the monitored data - the initSendStats API should be called first, before calling a sendStats (In order to connect to the perfdaemon initially)
|
| | initSendStats (char* monitorClientIP, int port = PERF_DAEMON_DEFAULT_PORT) Initialize sendStats - provide the IP of the perfDaemon and an optional port number to connect to |
|
| exitSendStats () Properly delete the perfDaemonClient after sendStats is done |
| |
|
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.
Note also that the callback function will also be given a pointer to a CAVERNnet_udp_c object that can then be used to send data directly to the client that originally sent the message.
Also, it should be noted that a showStats call should be made at the end of atleast one send and receive for two-way information (the same applies for logStats and sendStats)
void setIncomingPort(unsigned short port = 6000)
void setTimeOutTime(int secs)
void setMulticastAddress(char *ipAddr, unsigned short port)
int process()
void intercept(int (*callback) (CAVERNnet_udp_c *client, char** buffer, int *bufferSize, void *userData), void* userData)
void showStats(char* streamInfo, char* comment)
comment -
A comment on the event that marks the time at which the stream is being monitored
int logStats(char* streamInfo, char* comment, FILE* filePtr)
comment -
A comment on the event that marks the time at which the stream is being monitored
filePtr -
File pointer to the file in which the results of monitoring are to be stored
int sendStats(char* streamInfo, char* comment)
comment -
A comment on the event that marks the time at which the stream is being monitored
int initSendStats(char* monitorClientIP, int port = PERF_DAEMON_DEFAULT_PORT)
port -
Port number at which the perfDaemon is running -this is optional. The default port number for perfDaemon is 9500 -so a different port number has to be specified if the perfDaemon is running ona different port.
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