#include <CAVERNnet_perfClient_c.hxx>
Public Methods | |
CAVERNnet_perfDaemonClient_c (int isPerfClient=0) | |
CAVERNnet_perfDaemonClient_c (CAVERNnet_tcpClient_c *, int isPerfClient=0) | |
Use this constructor if you have a pre-opened socket. | |
~CAVERNnet_perfDaemonClient_c () | |
int | read (char **ret, int *nbytes, int blockingType) |
int | write (char *outgoingData, int *nbytes) |
int | isReadyToRead () |
int | isReadyToWrite () |
int | isReady () |
void | showStatus (int status, int nbytes) |
Show status of connection in English. | |
void | showStats () |
Show statistics of a connection. | |
void | close () |
Close the current client connection. | |
int | connectToServer (char *ip, int port=PERF_DAEMON_DEFAULT_PORT) |
void | setTimeOut (int timeout=CAVERNnet_perfDaemonClient_c::NO_TIME_OUT) |
unsigned int | getRemoteIP () |
void | getRemoteIP (char *name) |
unsigned int | getSelfIP () |
Get IP address of self. | |
void | getSelfIP (char *name) |
Get IP address of self. | |
int | getSelfPort () |
Get port of self. | |
int | getRemotePort () |
Get port of client. | |
Static Public Attributes | |
const int | OK |
Status ok. | |
const int | FAILED |
Status failed. | |
const int | MEM_ALLOC_ERR |
Memory allocation error. | |
const int | NON_BLOCKING_HAS_NO_DATA |
A non-blocking read had no data available to read. | |
const int | CONNECTION_TERMINATED |
Connection terminated. | |
const int | NOT_READY |
Connection not ready for use. | |
const int | READY_TO_READ |
Connection has data available to read. | |
const int | READY_TO_WRITE |
Connection is ready to write. | |
const int | READY_TO_READ_AND_WRITE |
Connection has data available to read and is ready to write. | |
const int | BLOCKING |
const int | NON_BLOCKING |
const int | NO_TIME_OUT |
Private Attributes | |
CAVERNnet_tcpClient_c* | client |
int | timeOut |
int | connectionAlive |
int | perfClient |
CAVERNnet_perfDaemonClient_c is a specially designed class specifically for use with CAVERNnet_perfDaemon_c class or performance monitoring daemon application that instantiates and utilizes CAVERNnet_perfDaemon_c class. This class can be used if you want to do one of the following:
First, it can be used to communicate directly with performance daemon. If you want to send special messages to the daemon, you can use this class for the purpose. Second, you are developing real time performance monitoring applications like QoSiMoto.
If you want to send your own special messages to performance monitoring daemon, you have to simply instantiate this class and use provided methods to send special messages to the performance daemon. If your interest is in monitoring the performance characteristics of other applications then you need to register as performance monitoring client when you instantiate this class. Read the description of constructors to find out how to register your application as performance monitoring client.
|
Constructor
|
|
Connect to a server.
|
|
Get the IP address of remote connection. If you are a client this returns the ip of the destination server. If you are a server this returns the ip of the destination client. |
|
Get the IP address of remote connection. If you are a client this returns the ip of the destination server. If you are a server this returns the ip of the destination client. |
|
Determines if a socket is ready to write or read or both. |
|
Determines if a socket has data available to read.
|
|
Determines if a socket is ready to write.
|
|
Read data from a reflector (if available).
|
|
Set timeout for read and writes. By default no time out is set. Setting time out means that if the read or write is unsuccessful after a certain amount of time the connection will be terminated. This is to prevent you from doing subsequent writes or reads from the stream and getting incorrect data. In order to re-establish the connection you need to instantiate another object of this type. |
|
Write data to the reflector.
|