class CAVERNnet_parallelTcpServer_c : public CAVERNnet_socketbase_c

If you are writing a server you need to instantiate a CAVERNnet_parallelTcpServer_c object

Inheritance:


Public Methods

int init (int port)
Open the server on a port
void close ()
Close the server port.
CAVERNnet_parallelTcpClient_c* checkForNewConnections ()
Check to see if there is a request from clients for connection
unsigned int getSelfIP ()
Get IP address of self.
int getSelfPort ()
Get port of self.

Public


static const int OK
Status ok.
static const int FAILED
Status failed.

Inherited from CAVERNnet_socketbase_c:

Public Methods

static int hostnameToIP(char *hostname, char* hostIP)
static void ipNumToString(unsigned int ip, char *ipstring)
static double getTimeInSecs()
static void getHostName(char *name, int len)
static void expandHostName(char *src, char *newname, int len)
unsigned int getTotalDataSent()
unsigned int getTotalDataRead()
double getInstantReceiveBandwidth()
double getInstantSendBandwidth()
double getAverageReceiveBandwidth()
double getAverageSendBandwidth()
void setInstantLatency(double lat)
double getInstantLatency()
double getAverageLatency()
double getMaxLatency()
double getMinLatency()
void incrementDataSent(unsigned long size)
void incrementDataRead(unsigned long size)
double getInstantInterMesgDelay()
double getMaxInterMesgDelay()
double getMinInterMesgDelay()
double getAverageInterMesgDelay()
double getSTABandwidth()
double getSTALatency()
double getBurstiness()
double getJitter()
unsigned long getPacketsRead()
unsigned long getPacketsSent()
virtual int getSocketId()
int selectSock(void *ptr, int *status, int numSocks, struct timeval *timeout)

Protected Methods

void computeInstantSendBandwidth()
void computeInstantReceiveBandwidth()
void computeAverageReceiveBandwidth()
void computeAverageSendBandwidth()
void calculateJitter(double lat)
void calculateBurstiness(double bw)

Documentation

If you are writing a server you need to instantiate a CAVERNnet_parallelTcpServer_c object. Likewise if you are writing a client you need to instantiate a CAVERNnet_parallelTcpClient_c object.

Server setup: First, instantiate the CAVERNnet_parallelTcpServer_c class. Then call this object's init() method with the desired port number as parameter. After this, we call CAVERNnet_parallelTcpServer_c::checkForNewConnections(PortNumber). This is a blocking call that waits for the client to make a CAVERNnet_parallelTcpClient_c::connectToServer() call. checkForNewConnections() returns a pointer to a CAVERNnet_parallelTcpClient_c object, which you can use to communicate with the client. Note that you do not explicitly instantiate a CAVERNnet_parallelTcpClient_c object when you are using the server class. You can just declare a pointer to the client object and assign to this variable the return value of CAVERNnet_parallelTcpServer_c::checkForNewConnections function.

Client setup: We instantiate the CAVERNnet_parallelTcpClient_c class and call the CAVERNnet_parallelTcpClient_c::connectToServer(MachineName,PortNumber,NumberOfSockets) method. We then use this object to do a write and read.

int init(int port)
Open the server on a port. Typically after this call you sit in a loop and call checkForNewConnections to wait for incoming connections.
Returns:
FAILED if failed, OK if success

CAVERNnet_parallelTcpClient_c* checkForNewConnections()
Check to see if there is a request from clients for connection. If yes then return a CAVERNnet_parallelTcpClient_c object which you can then use to talk to the client.
See Also:
CAVERNnet_parallelTcpClient_c class.


Direct child classes:
CAVERNnet_extendedParallelTcpServer_c

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