class otnetDemon

Class otnetDemon: class that encapsulates a generic demon

Public Methods

inline int getDemonStatus()
Returns 0 if a good status
int handleConnections()
Main loop in which we wait for connections
otnetDemon( int iPort )
Constructor
virtual void startServer( int iNewSocket )
Pure virtual function that is called when a connection has been established
virtual ~otnetDemon()
Destructor

Private Fields

int iStatus
Status word of the demon
int sockfd
Socket where the demon listens

Documentation

Class otnetDemon: class that encapsulates a generic demon. The demon is listening on a well known port and accepts connection requests from clients. When a connection is established, a child is forked off and startServer is called. startServer is an overloaded function and has the application specific stuff in it. Note that this is an abstract base class. An example how to use it is the dd_demon of the DD package.

The code structure has been taken of W.R.Stevens book.

Modifications:

otnetDemon( int iPort )
Constructor. Has the port of the demon as argument

virtual ~otnetDemon()
Destructor. Make it virtual as the otnetDemon class is meant to be only used as a base class.

inline int getDemonStatus()
Returns 0 if a good status. Has to be used in order to find out whether the constructor has succeeded as we do not use exception handling.

int handleConnections()
Main loop in which we wait for connections

virtual void startServer( int iNewSocket )
Pure virtual function that is called when a connection has been established. Contains the application specific code.

int sockfd
Socket where the demon listens

int iStatus
Status word of the demon. 0 for success, -1 for failure.


This class has no child classes.
Author:
C.Witzig
Date: May 23, 1999
Version:
Last update:

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