class CAVERNnet_udp_c : public CAVERNnet_socketbase_c UDP Class
| | enableInstrumentation () Enable the logging of latency and inter-message delay |
| | disableInstrumentation () Disable the logging of latency and inter-message delay |
| | setTimeOut (int t) Set timeout period when performing read() or write() operations |
|
| getTimeOut () Get timeout period |
| | init (unsigned short port = 0) Open a socket |
| | setSendAddress (char *host, unsigned short port) Set address to send to |
| | copyReceiveAddressToSendAddress () Copy the receive address to send address |
| | clone () Make a clone of the current udp object |
| | send (char *message, int length, int blockingType = CAVERNnet_udp_c::NULL_VALUE) Send data |
| | receive (char *message, int length, int blockingType = CAVERNnet_udp_c::NULL_VALUE) Receive data |
| | peek (char *message, int length) Peek at incoming packet |
|
| makeNonBlocking () Make a connection non blocking (This method is being phased out of the distribution - you can set the blocking type in send() or receive() directly) |
|
| printInfo () Print information on the connection (IP address, port number etc). |
| | close () Close the udp handle |
| | 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 |
|
| Status values
| ||||||||||||||||||||
|
| Blocking parameter values for Read/Write method.
| ||||||||||||||||||||
|
| Time out values.
| ||||||||||||||||||||
|
| Return values from Read/Write methods.
| ||||||||||||||||||||
|
| Accessor Functions
|
UDP Class. This class bypasses CAVERN's standard method for establishing connections and provides the user with direct control of UDP connections. The idea is that you first create a udp object and then call the init() method. (see init() method for more details). Then you can either Send data to a destination or receive any incoming data.To send data to a destination you need to set the destination with the SetSendAddress method and then call the Send method.
To receive data, simply call the Receive method.
By default the connections are BLOCKING, which means, if you call Receive and there is no data available to read your program will block until something comes along. To make your receives or sends non blocking, use the NON_BLOCKING flag as a parameter to the receive() or send().In the previous versions the makeNonBlocking() method was used. The makeNonBlocking() is being phased out.
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 disableInstrumentation()
void setTimeOut(int t)
int init(unsigned short port = 0)
int setSendAddress(char *host, unsigned short port)
void copyReceiveAddressToSendAddress()
CAVERNnet_udp_c* clone()
int send(char *message, int length, int blockingType = CAVERNnet_udp_c::NULL_VALUE)
blockingType -
Default value of this argument is CAVERNnet_udp_c::NULL_VALUE.
It can be set to CAVERNnet_udp_c::BLOCKING or
CAVERNnet_udp_c::NON_BLOCKING.
If a value is not passed the blocking type is changed to the value
stored by the private memeber 'typeOfBlocking'.
int receive(char *message, int length, int blockingType = CAVERNnet_udp_c::NULL_VALUE)
blockingType -
Default value of this argument is CAVERNnet_udp_c::NULL_VALUE.
It can be set to CAVERNnet_udp_c::BLOCKING or
CAVERNnet_udp_c::NON_BLOCKING.
If a value is not passed the blocking type is changed to the value
stored by the private memeber 'typeOfBlocking'.
int peek(char *message, int length)
void close()
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