#include <QUANTAnet_extendedParallelTcp_c.hxx>
Inheritance diagram for QUANTAnet_extendedParallelTcpClient_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_parallelTcp_c class and thus, compatible with the class. So it is possible to use QUANTAnet_extendedParallelTcpClient_c in a machine and use QUANTAnet_parallelTcp_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 all numerical values by yourself. If you want to use this class in the server side, make sure to create an instance of QUANTAnet_extendedParallelTcpServer_c class instead of QUANTAnet_ParallelTcpServer_c since QUANTAnet_extendedParallelTcpServer_c gives you access to all methods available in this client class.
Public Member Functions | |
| int | readChar (char &value) |
| reads a character | |
| int | writeChar (char value) |
| writes a character | |
| int | readInt (int &value) |
| reads an integer value | |
| int | readIntArray (int *intArray, int size) |
| reads a number of integer values | |
| int | writeInt (int value) |
| writes an integer value | |
| int | writeIntArray (int *intArray, int size) |
| writes a number of integer values | |
| int | readInt32 (int32 &value) |
| reads a 32-bit integer value | |
| int | readInt32Array (int32 *int32Array, int size) |
| reads a number of 32-bit integer values | |
| int | writeInt32 (int32 value) |
| writes a 32-bit integer value | |
| int | writeInt32Array (int32 *int32Array, int size) |
| writes a number of 32-bit integer values | |
| int | readInt64 (int64 &value) |
| reads a 64-bit integer value | |
| int | readInt64Array (int64 *int64Array, int size) |
| reads a number of 64-bit integer values | |
| int | writeInt64 (int64 value) |
| writes a 64-bit integer value | |
| int | writeInt64Array (int64 *int64Array, int size) |
| writes a number of 64-bit integer values | |
| int | readLong (long &value) |
| reads a long integer value | |
| int | readLongArray (long *longArray, int size) |
| reads a number of long integer values | |
| int | writeLong (long value) |
| writes a long integer value | |
| int | writeLongArray (long *longArray, int size) |
| writes a number of long integer values | |
| int | readFloat (float &value) |
| reads a single precision floating point value | |
| int | readFloatArray (float *floatArray, int size) |
| reads a number of float values | |
| int | writeFloat (float value) |
| writes a float value | |
| int | writeFloatArray (float *floatArray, int size) |
| writes a number of float values | |
| int | readDouble (double &value) |
| reads a double precision floating point value | |
| int | readDoubleArray (double *doubleArray, int size) |
| reads a number of double values | |
| int | writeDouble (double value) |
| writes an integer value | |
| int | writeDoubleArray (double *doubleArray, int size) |
| writes a number of double values | |
| int | write (char *buffer, int *length) |
| After returning from checkForNewConnections() or after calling connectToServer(), you can now call write() to send Length bytes of data starting at Buffer. | |
| int | read (char *buffer, int *length) |
| After returning from checkForNewConnections() or after calling connectToServer(), you can now call write() to send Length bytes of data starting at Buffer. | |
| void | close () |
| Close down the multiple socket handles. | |
| int | connectToServer (char *RemoteName, int RemotePort, int Size) |
| We instantiate a QUANTAnet_parallelTcpClient_c object and calls this connectToServer() method to connect to machine named "RemoteName" on port Port. | |
| 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. | |
| virtual int | getSocketId () |
| Returns the socket id. | |
| 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. | |
| 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. | |
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 | OK |
| Operation successful. | |
| const int | FAILED |
| Operation failed. | |
| const int | OK |
| Operation successful. | |
| 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. | |
|
||||||||||||||||
|
We instantiate a QUANTAnet_parallelTcpClient_c object and calls this connectToServer() method to connect to machine named "RemoteName" on port Port. We specify the number of simultaneous socket connections in the Size parameter. After this call is successfully called, you can then use read and write methods.
|
|
|
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. |
|
||||||||||||
|
After returning from checkForNewConnections() or after calling connectToServer(), you can now call write() to send Length bytes of data starting at Buffer.
|
|
|
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
|
|
||||||||||||
|
After returning from checkForNewConnections() or after calling connectToServer(), you can now call write() to send Length bytes of data starting at Buffer.
|
|
|
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