class CAVERNnet_tcpClient_c : public CAVERNnet_socketbase_c TCP Class for creating client connections
| | setTimeOut (int t) Set timeout period when performing read() or write() operations |
|
| getTimeOut () Get timeout period |
| | setClientInfo (struct sockaddr_in* info) Set client info |
| | setClientSockFd (int sockfd) Set client socket |
|
| showStatus (int status, int nbytes) Show status of connection in English. |
|
| close () Close the current client connection. |
| | connectToServer (char *ip, int port) Connect to a server |
| | 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 over 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 perFDaemon Client after sendStats is done |
|
| Blocking parameter values for Read/Write method.
| ||||||||||||||||||||||||
|
| Time out values.
| ||||||||||||||||||||||||
|
| Return values from Read/Write methods.
| ||||||||||||||||||||||||
|
| Accessor functions
| ||||||||||||||||||||||||
| | Read and Write calls. |
TCP Class for creating client connections. This class bypasses CAVERN's standard method for establishing connections and provides the user with direct control of TCP connections.
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 setClientInfo(struct sockaddr_in* info)
void setClientSockFd(int sockfd)
unsigned int getRemoteIP()
void getRemoteIP(char* name)
Read and Write calls.
int read(char *ptr, int *nbytes, int blockingType)
blockingtype -
BLOCKING means that it will block waiting for data or until
the timeout period expires. Change the timeout period by
calling setTimeOut().
NON_BLOCKING means that if there is no data to be read this call will
return immediately. If it does get some data it will keep reading
until the specified number of bytes is received, or if it timesout, or if
the connection is broken. In the latter two cases the number of bytes
it was able to read is returned.
In either the BLOCKING or NON_BLOCKING case you can set the
time out period to never time out by setting the timeout
time to: NO_TIME_OUT.
void setSockOptions(int option, int buffersize)
buffersize -
Specify the size.
int isReadyToRead()
int isReadyToWrite()
int isReady()
int write(char *ptr, int *nbytes, int blockingType)
int connectToServer(char *ip, int port)
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