Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members

QUANTAnet_extendedParallelTcpClient_c Class Reference

#include <QUANTAnet_extendedParallelTcp_c.hxx>

Inheritance diagram for QUANTAnet_extendedParallelTcpClient_c:

QUANTAnet_parallelTcpClient_c QUANTAnet_socketbase_c List of all members.

Detailed Description

This class is designed to help users minimize their effort of packing and unpacking numerical values every time they need to send one.

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.


Member Function Documentation

int QUANTAnet_parallelTcpClient_c::connectToServer char *  RemoteName,
int  RemotePort,
int  Size
[inherited]
 

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.

Parameters:
RemoteName A character string, name of the machine where the remote server is.
Port Port number which the remote server is listening to.
Size The number of simultaneous sockets we are to use.
Returns:
Either QUANTAnet_parallelTcpClient_c::OK or QUANTAnet_parallelTcpClient_c::FAILED

void QUANTAnet_parallelTcpClient_c::getRemoteIP char *  name  )  [inherited]
 

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.

unsigned int QUANTAnet_parallelTcpClient_c::getRemoteIP  )  [inherited]
 

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.

int QUANTAnet_parallelTcpClient_c::read char *  buffer,
int *  length
[inherited]
 

After returning from checkForNewConnections() or after calling connectToServer(), you can now call write() to send Length bytes of data starting at Buffer.

Returns:
Either QUANTAnet_parallelTcpClient_c::OK or QUANTAnet_parallelTcpClient_c::FAILED
Parameters:
Buffer A pointer to the buffer that will store the received data.
Length Number of bytes to be received.

int QUANTAnet_extendedParallelTcpClient_c::readChar char &  value  ) 
 

reads a character

Parameters:
value character you want to write to the network stream

int QUANTAnet_extendedParallelTcpClient_c::readDouble double &  value  ) 
 

reads a double precision floating point value

Parameters:
value double value you want to read from the network stream

int QUANTAnet_extendedParallelTcpClient_c::readDoubleArray double *  doubleArray,
int  size
 

reads a number of double values

Parameters:
doubleArray array of double values to store the values read from network stream
size the number of double values you want to send

int QUANTAnet_extendedParallelTcpClient_c::readFloat float &  value  ) 
 

reads a single precision floating point value

Parameters:
value float value you want to read from the network stream

int QUANTAnet_extendedParallelTcpClient_c::readFloatArray float *  floatArray,
int  size
 

reads a number of float values

Parameters:
floatArray array of float values that store the values read from network stream
size the number of float values you want to send

int QUANTAnet_extendedParallelTcpClient_c::readInt int &  value  ) 
 

reads an integer value

Parameters:
value integer value you want to read from the network stream

int QUANTAnet_extendedParallelTcpClient_c::readInt32 int32 &  value  ) 
 

reads a 32-bit integer value

Parameters:
value 32-bit integer value that will be read from the network stream

int QUANTAnet_extendedParallelTcpClient_c::readInt32Array int32 *  int32Array,
int  size
 

reads a number of 32-bit integer values

Parameters:
int32Array array of 32-bit integers to store the values read from network stream
size the number of 32-bit integers you want to send

int QUANTAnet_extendedParallelTcpClient_c::readInt64 int64 &  value  ) 
 

reads a 64-bit integer value

Parameters:
value 64-bit integer value that will be read from the network stream

int QUANTAnet_extendedParallelTcpClient_c::readInt64Array int64 *  int64Array,
int  size
 

reads a number of 64-bit integer values

Parameters:
int64Array array of 64-bit integers to store the values read from network stream
size the number of 64-bit integers you want to send

int QUANTAnet_extendedParallelTcpClient_c::readIntArray int *  intArray,
int  size
 

reads a number of integer values

Parameters:
intArray array of integers to store the values read from network stream
size the number of integers you want to send

int QUANTAnet_extendedParallelTcpClient_c::readLong long &  value  ) 
 

reads a long integer value

Parameters:
value long integer value you want to read from the network stream

int QUANTAnet_extendedParallelTcpClient_c::readLongArray long *  longArray,
int  size
 

reads a number of long integer values

Parameters:
longArray array of long integers to store the values read from network stream
size the number of long integers you want to send

int QUANTAnet_parallelTcpClient_c::write char *  buffer,
int *  length
[inherited]
 

After returning from checkForNewConnections() or after calling connectToServer(), you can now call write() to send Length bytes of data starting at Buffer.

Returns:
Either QUANTAnet_parallelTcpClient_c::OK or QUANTAnet_parallelTcpClient_c::FAILED
Parameters:
Buffer A pointer to the buffer to be sent.
Length Number of bytes to be sent.

int QUANTAnet_extendedParallelTcpClient_c::writeChar char  value  ) 
 

writes a character

Parameters:
value character that is going to be read from the network stream

int QUANTAnet_extendedParallelTcpClient_c::writeDouble double  value  ) 
 

writes an integer value

Parameters:
value double value that is going to be written to the network stream

int QUANTAnet_extendedParallelTcpClient_c::writeDoubleArray double *  doubleArray,
int  size
 

writes a number of double values

Parameters:
doubleArray double values that will be sent to the network stream
size the number of double values you want to send

int QUANTAnet_extendedParallelTcpClient_c::writeFloat float  value  ) 
 

writes a float value

Parameters:
value float value that is going to be written to the network stream

int QUANTAnet_extendedParallelTcpClient_c::writeFloatArray float *  floatArray,
int  size
 

writes a number of float values

Parameters:
floatArray float values that will be sent to the network stream
size the number of float values you want to send

int QUANTAnet_extendedParallelTcpClient_c::writeInt int  value  ) 
 

writes an integer value

Parameters:
value integer value that is going to be written to the network stream

int QUANTAnet_extendedParallelTcpClient_c::writeInt32 int32  value  ) 
 

writes a 32-bit integer value

Parameters:
value 32-bit integer value that is going to be written to the network stream

int QUANTAnet_extendedParallelTcpClient_c::writeInt32Array int32 *  int32Array,
int  size
 

writes a number of 32-bit integer values

Parameters:
int32Array 32-bit integer values that will be sent to the network stream
size the number of 32-bit integers you want to send

int QUANTAnet_extendedParallelTcpClient_c::writeInt64 int64  value  ) 
 

writes a 64-bit integer value

Parameters:
value 64-bit integer that is going to be written to the network stream

int QUANTAnet_extendedParallelTcpClient_c::writeInt64Array int64 *  int64Array,
int  size
 

writes a number of 64-bit integer values

Parameters:
int64Array 64-bit integer values that will be sent to the network stream
size the number of 64-bit integers you want to send

int QUANTAnet_extendedParallelTcpClient_c::writeIntArray int *  intArray,
int  size
 

writes a number of integer values

Parameters:
intArray integer values that will be sent to the network stream
size the number of integers you want to send

int QUANTAnet_extendedParallelTcpClient_c::writeLong long  value  ) 
 

writes a long integer value

Parameters:
value long integer value that is going to be written to the network stream

int QUANTAnet_extendedParallelTcpClient_c::writeLongArray long *  longArray,
int  size
 

writes a number of long integer values

Parameters:
longArray long integer values that will be sent to the network stream
size the number of long integers you want to send


The documentation for this class was generated from the following file:
Generated on Tue Jun 6 16:06:25 2006 for QUANTA by doxygen 1.3.8