Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CAVERNnet_tcpServer_c Class Reference

#include <CAVERNnet_tcp_c.hxx>

Inheritance diagram for CAVERNnet_tcpServer_c::

CAVERNnet_socketbase_c CAVERNnet_extendedTcpServer_c List of all members.

Public Methods

void setTimeOut (int t)
int getTimeOut ()
 Get timeout period.

 CAVERNnet_tcpServer_c ()
 ~CAVERNnet_tcpServer_c ()
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)
void close ()
 Close the server port.

CAVERNnet_tcpClient_ccheckForNewConnections ()

Static Public Attributes

const int OK
 Status ok.

const int FAILED
 Status failed.


Protected Attributes

int serverPort
int timeOutPeriod
int sockfd
struct sockaddr_in serverInfo

Detailed Description

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.


Member Function Documentation

CAVERNnet_tcpClient_c * CAVERNnet_tcpServer_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.

Reimplemented in CAVERNnet_extendedTcpServer_c.

int CAVERNnet_tcpServer_c::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

void CAVERNnet_tcpServer_c::setTimeOut ( int t ) [inline]
 

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.


The documentation for this class was generated from the following file:
Generated at Mon Jul 2 14:24:45 2001 for CAVERNsoft by doxygen1.2.8-20010617 written by Dimitri van Heesch, © 1997-2001