#include <QUANTAnet_extendedTcp_c.hxx>
Inheritance diagram for QUANTAnet_extendedTcpClient_c:

All methods provided in this class will pack values before writing them to the network. Again, all methods available in this class will unpack all values gotten from the network before returning them to the users. This class is derived from QUANTAnet_tcp_c class and thus, compatible with the class. So it is possible to use QUANTAnet_extendedTcpClient_c in a machine and use QUANTAnet_tcp_c class in the other, or vice versa; you are just losing the convenience of using simple methods provided in this class in return and you have to pack and unpack by yourself. If you want to use this class in the server side, make sure to create an instance of QUANTAnet_extendedTcpServer_c class instead of QUANTAnet_tcpServer_c since QUANTAnet_extendedTcpServer_c gives you access to all methods available in this client class.
Public Member Functions | |
| int | readChar (char &value, int blockingType) |
| reads a character | |
| int | writeChar (char value, int blockingType) |
| writes a character | |
| int | readInt (int &value, int blockingType) |
| reads an integer value | |
| int | readIntArray (int *intArray, int size, int blockingType) |
| reads a number of integer values | |
| int | writeInt (int value, int blockingType) |
| writes an integer value | |
| int | writeIntArray (int *intArray, int size, int blockingType) |
| writes a number of integer values | |
| int | readInt32 (int32 &value, int blockingType) |
| reads a 32-bit integer value | |
| int | readInt32Array (int32 *int32Array, int size, int blockingType) |
| reads a number of 32-bit integer values | |
| int | writeInt32 (int32 value, int blockingType) |
| writes a 32-bit integer value | |
| int | writeInt32Array (int32 *int32Array, int size, int blockingType) |
| writes a number of 32-bit integer values | |
| int | readInt64 (int64 &value, int blockingType) |
| reads a 64-bit integer value | |
| int | readInt64Array (int64 *int64Array, int size, int blockingType) |
| reads a number of 64-bit integer values | |
| int | writeInt64 (int64 value, int blockingType) |
| writes a 64-bit integer value | |
| int | writeInt64Array (int64 *int64Array, int size, int blockingType) |
| writes a number of 64-bit integer values | |
| int | readLong (long &value, int blockingType) |
| reads a long integer value | |
| int | readLongArray (long *longArray, int size, int blockingType) |
| reads a number of long integer values | |
| int | writeLong (long value, int blockingType) |
| writes a long integer value | |
| int | writeLongArray (long *longArray, int size, int blockingType) |
| writes a number of long integer values | |
| int | readFloat (float &value, int blockingType) |
| reads a single precision floating point value | |
| int | readFloatArray (float *floatArray, int size, int blockingType) |
| reads a number of float values | |
| int | writeFloat (float value, int blockingType) |
| writes a float value | |
| int | writeFloatArray (float *floatArray, int size, int blockingType) |
| writes a number of float values | |
| int | readDouble (double &value, int blockingType) |
| reads a double precision floating point value | |
| int | readDoubleArray (double *doubleArray, int size, int blockingType) |
| reads a number of double values | |
| int | writeDouble (double value, int blockingType) |
| writes an integer value | |
| int | writeDoubleArray (double *doubleArray, int size, int blockingType) |
| writes a number of double values | |
| void | setTimeOut (int t) |
| Set timeout period when performing read() or write() operations. | |
| int | getTimeOut () |
| Get timeout period. | |
| void | setClientInfo (struct sockaddr_in *info) |
| Set client info. | |
| void | setClientSockFd (int sockfd) |
| Set client socket. | |
| unsigned int | getTotalDataSent () |
| Get the total data sent by a connection. | |
| unsigned int | getTotalDataRead () |
| Get total data received by a connection. | |
| double | getInstantReceiveBandwidth () |
| Get total instantaneous incoming bandwidth by a connection. | |
| double | getInstantSendBandwidth () |
| Get total instantaneous outgoing bandwidth by a connection. | |
| double | getAverageReceiveBandwidth () |
| Get average incoming bandwidth by a connection. | |
| double | getAverageSendBandwidth () |
| Get average outgoing bandwidth by a connection. | |
| void | setInstantLatency (double lat) |
| Set the instantaneous latency and also calculate the STALatency and Jitter values automatically. | |
| double | getInstantLatency () |
| Retrieve most recent incoming packet's latency. | |
| double | getAverageLatency () |
| Retrieve average incoming latency. | |
| double | getMaxLatency () |
| Retrieve max latency so far. | |
| double | getMinLatency () |
| Retrieve min latency so far. | |
| void | incrementDataSent (unsigned long size) |
| Record amount of data sent. | |
| void | incrementDataRead (unsigned long size) |
| Record amount of data read - and also compute instantaneous, average bandwidths along with the inter message delay values. | |
| double | getInstantInterMesgDelay () |
| Get instantaneous inter-message delay (jitter). | |
| double | getMaxInterMesgDelay () |
| Get max inter-message delay (jitter). | |
| double | getMinInterMesgDelay () |
| Get min inter-message delay (jitter). | |
| double | getAverageInterMesgDelay () |
| Get average inter-message delay (jitter). | |
| double | getSTABandwidth () |
| Get the Short Term Average Bandwidth -over a fixed number of packets (defined by BANDWIDTH_BUF_SIZE). | |
| double | getSTALatency () |
| Get the Short Term Average Latency -over a number of packets (defined by LATENCY_BUF_SIZE). | |
| double | getBurstiness () |
| get the burstinesss | |
| double | getJitter () |
| Get the Jitter. | |
| unsigned long | getPacketsRead () |
| Return the total number of packets read. | |
| unsigned long | getPacketsSent () |
| Return the total number of packets sent. | |
| unsigned int | getRemoteIP () |
| Get the IP address of remote connection. | |
| void | getRemoteIP (char *name) |
| Get the IP address of remote connection. | |
| int | getSelfPort () |
| Get port of self. | |
| int | getRemotePort () |
| Get port of client. | |
| int | getSocketId () |
| Get socket id. | |
Read and Write calls. | |
| int | read (char *ptr, int *nbytes, int blockingType) |
| void | setSockOptions (int option, int buffersize) |
| Allows you to change the parameters to the setsockopt() options.Currently this member allows you to change socket buffer size. | |
| int | isReadyToRead () |
| Determines if a socket has data available to read. | |
| int | isReadyToWrite () |
| Determines if a socket is ready to write. | |
| int | isReady () |
| Determines if a socket is ready to write or read or both. | |
| int | write (const char *ptr, int *nbytes, int blockingType) |
| Write data to socket. | |
| void | showStatus (int status, int nbytes) |
| Show status of connection in English. | |
| int | close () |
| Close the current client connection. | |
| int | connectToServer (const char *ip, int port) |
| Connect to a server. | |
| void | 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. | |
| int | logStats (char *streamInfo, char *comment, FILE *filePtr) |
| This logs performance statistics in a file. | |
| int | 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). | |
| int | initSendStats (const char *monitorClientIP, int port=PERF_DAEMON_DEFAULT_PORT) |
| Initialize sendStats - provide the IP of the perfDaemon and an optional port number to connect to. | |
| void | exitSendStats () |
| Properly delete the perFDaemon Client after sendStats is done. | |
| int | readv (QUANTAnet_iovec_c q_iovec, int blockingType) |
| int | writev (QUANTAnet_iovec_c q_iovec, int blockingType) |
| unsigned int | getRemoteIP () |
| Get the IP address of remote connection. | |
| void | getRemoteIP (char *name) |
| Get the IP address of remote connection. | |
| int | getSelfPort () |
| Get port of self. | |
| int | getRemotePort () |
| Get port of client. | |
| int | getSocketId () |
| Get socket id. | |
Read and Write calls. | |
| int | read (char *ptr, int *nbytes, int blockingType) |
| void | setSockOptions (int option, int buffersize) |
| Allows you to change the parameters to the setsockopt() options.Currently this member allows you to change socket buffer size. | |
| int | isReadyToRead () |
| Determines if a socket has data available to read. | |
| int | isReadyToWrite () |
| Determines if a socket is ready to write. | |
| int | isReady () |
| Determines if a socket is ready to write or read or both. | |
| int | write (const char *ptr, int *nbytes, int blockingType) |
| Write data to socket. | |
| void | showStatus (int status, int nbytes) |
| Show status of connection in English. | |
| int | close () |
| Close the current client connection. | |
| int | connectToServer (const char *ip, int port) |
| Connect to a server. | |
| void | 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. | |
| int | logStats (char *streamInfo, char *comment, FILE *filePtr) |
| This logs performance statistics in a file. | |
| int | 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). | |
| int | initSendStats (const char *monitorClientIP, int port=PERF_DAEMON_DEFAULT_PORT) |
| Initialize sendStats - provide the IP of the perfDaemon and an optional port number to connect to. | |
| void | exitSendStats () |
| Properly delete the perFDaemon Client after sendStats is done. | |
| int | readv (QUANTAnet_iovec_c q_iovec, int blockingType) |
| int | writev (QUANTAnet_iovec_c q_iovec, int blockingType) |
Static Public Member Functions | |
| int | hostnameToIP (const char *hostname, char *hostIP) |
| Convert a hostname to an ip address of xxx.xxx.xxx.xxx. | |
| void | ipNumToString (unsigned int ip, char *ipstring) |
| Convert ip address to a string of xxx.xxx.xxx.xxx. | |
| double | getTimeInSecs () |
| Get time in secs with microsecond accuracy. | |
| void | getHostName (char *name, int len) |
| Get the full host name of a local client. | |
| void | expandHostName (const char *src, char *newname, int len) |
| If hostname is not fully expanded (ie does not include its domain) then expand it. | |
| long | getSelfIP () |
| Get the host IP address as a long integer. | |
| void | getSelfIP (char *) |
| Get the host IP address as a character string. | |
| int | selectSock (void *ptr, int *status, int numSocks, struct timeval *timeout) |
| Returns the status of the sockets being polled. | |
Static Public Attributes | |
| const int | BLOCKING |
| Make the connection blocking but time out eventually. | |
| const int | NON_BLOCKING |
| Make the connection non blocking. | |
| const int | NO_TIME_OUT |
| Used to set time out period to never time out. | |
| const int | DEFAULT_TIME_OUT |
| Default time out is no time out. | |
| const int | SOCKET_NOT_OPEN |
| Socket is not open. | |
| const int | CONNECTION_TERMINATED |
| Connection you attempted to read/write is terminated. | |
| const int | NON_BLOCKING_HAS_NO_DATA |
| You attempted to read with non blocking and there was not data. | |
| const int | TIMED_OUT |
| The read/write timed out. | |
| const int | OK |
| Read/Write succeeded. | |
| const int | NON_BLOCKING_NOT_READY_TO_WRITE |
| You attempted to write with non blocking and socket was not ready. | |
| const int | NOT_READY |
| Socket was not ready. | |
| const int | READY_TO_READ |
| Socket ready to read. | |
| const int | READY_TO_WRITE |
| Socket ready to write. | |
| const int | READY_TO_READ_AND_WRITE |
| Socket ready to read and write. | |
| const int | READ_BUFFER_SIZE |
| Change the socket buffer size before Read(). | |
| const int | WRITE_BUFFER_SIZE |
| Change the socket buffer size before Write(). | |
| const int | FAILED |
| Operation failed. | |
| const int | BLOCKING |
| Make the connection blocking but time out eventually. | |
| const int | NON_BLOCKING |
| Make the connection non blocking. | |
| const int | NO_TIME_OUT |
| Used to set time out period to never time out. | |
| const int | DEFAULT_TIME_OUT |
| Default time out is no time out. | |
| const int | SOCKET_NOT_OPEN |
| Socket is not open. | |
| const int | CONNECTION_TERMINATED |
| Connection you attempted to read/write is terminated. | |
| const int | NON_BLOCKING_HAS_NO_DATA |
| You attempted to read with non blocking and there was not data. | |
| const int | TIMED_OUT |
| The read/write timed out. | |
| const int | OK |
| Read/Write succeeded. | |
| const int | NON_BLOCKING_NOT_READY_TO_WRITE |
| You attempted to write with non blocking and socket was not ready. | |
| const int | NOT_READY |
| Socket was not ready. | |
| const int | READY_TO_READ |
| Socket ready to read. | |
| const int | READY_TO_WRITE |
| Socket ready to write. | |
| const int | READY_TO_READ_AND_WRITE |
| Socket ready to read and write. | |
| const int | READ_BUFFER_SIZE |
| Change the socket buffer size before Read(). | |
| const int | WRITE_BUFFER_SIZE |
| Change the socket buffer size before Write(). | |
| const int | FAILED |
| Operation failed. | |
Protected Member Functions | |
| void | computeInstantSendBandwidth () |
| Calculate the instantaneous outgoing bandwidth. | |
| void | computeInstantReceiveBandwidth () |
| Calculate the instantaneous incoming bandwidth. | |
| void | computeAverageReceiveBandwidth () |
| Calculate the average incoming bandwidth. | |
| void | computeAverageSendBandwidth () |
| Calculate the average outgoing bandwidth. | |
| void | calculateJitter (double lat) |
| Calculate the jitter over a specified number of packets. | |
| void | calculateBurstiness (double bw) |
| Calculate the burstiness over a specified number of packets. | |
|
||||||||||||
|
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. |
|
||||||||||||
|
Initialize sendStats - provide the IP of the perfDaemon and an optional port number to connect to. This should be done initially before using the sendStats API.
|
|
|
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.
|
|
||||||||||||||||
|
This logs performance statistics in a file. The user opens a file and passes the file pointer with this function and results of monitoring are written into the logfile.
|
|
||||||||||||||||
|
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.
|
|
||||||||||||
|
reads a character
|
|
||||||||||||
|
reads a double precision floating point value
|
|
||||||||||||||||
|
reads a number of double values
|
|
||||||||||||
|
reads a single precision floating point value
|
|
||||||||||||||||
|
reads a number of float values
|
|
||||||||||||
|
reads an integer value
|
|
||||||||||||
|
reads a 32-bit integer value
|
|
||||||||||||||||
|
reads a number of 32-bit integer values
|
|
||||||||||||
|
reads a 64-bit integer value
|
|
||||||||||||||||
|
reads a number of 64-bit integer values
|
|
||||||||||||||||
|
reads a number of integer values
|
|
||||||||||||
|
reads a long integer value
|
|
||||||||||||||||
|
reads a number of long integer values
|
|
||||||||||||
|
|
|
||||||||||||
|
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).
|
|
|
Set client info. For internal use.
|
|
|
Set client socket. For internal use.
|
|
||||||||||||
|
Allows you to change the parameters to the setsockopt() options.Currently this member allows you to change socket buffer size.
|
|
|
Set timeout period when performing read() or write() operations.
|
|
||||||||||||
|
Displays the resultant statistics instantaneously in the netlogger format - this should be typically done after a read/write is done over a network. 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)
|
|
||||||||||||||||
|
Write data to socket.
|
|
||||||||||||
|
writes a character
|
|
||||||||||||
|
writes an integer value
|
|
||||||||||||||||
|
writes a number of double values
|
|
||||||||||||
|
writes a float value
|
|
||||||||||||||||
|
writes a number of float values
|
|
||||||||||||
|
writes an integer value
|
|
||||||||||||
|
writes a 32-bit integer value
|
|
||||||||||||||||
|
writes a number of 32-bit integer values
|
|
||||||||||||
|
writes a 64-bit integer value
|
|
||||||||||||||||
|
writes a number of 64-bit integer values
|
|
||||||||||||||||
|
writes a number of integer values
|
|
||||||||||||
|
writes a long integer value
|
|
||||||||||||||||
|
writes a number of long integer values
|
|
||||||||||||
|
|
1.3.8