class CAVERNnet_tcpServer_c : public CAVERNnet_socketbase_c

TCP Class for creating servers

Inheritance:


Public Methods

void setTimeOut (int t)
Set timeout period when performing read() or write() operations
int getTimeOut ()
Get timeout period.
unsigned int getSelfIP ()
Get server's IP.
void getSelfIP (char* name)
Get server's IP
int getSelfPort ()
Get server's port.
int init (int port)
Open the server on a port
void close ()
Close the server port.
CAVERNnet_tcpClient_c* checkForNewConnections ()
Check to see if there is a request from clients for connection

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

TCP Class for creating servers. This class bypasses CAVERN's standard method for establishing connections and provides the user with direct control of TCP connections.

void setTimeOut(int t)
Set timeout period when performing read() or write() operations
Parameters:
t - Time out period in seconds. Set to CAVERNnet_tcpClient_c::NO_TIME_OUT to set no time out period.

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_tcpClient_c* checkForNewConnections()
Check to see if there is a request from clients for connection. If yes then return a CAVERNnet_tcpClient_c object which you can then use to talk to the client.
See Also:
CAVERNnet_tcpClient_c class.


Direct child classes:
CAVERNnet_extendedTcpServer_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