rasdaman complete source
Public Member Functions | Protected Member Functions | List of all members
akg::BlockingServer Class Referenceabstract

#include <akgnet_server.hh>

Inheritance diagram for akg::BlockingServer:
akg::GenericServer

Public Member Functions

 BlockingServer () throw ()
 Default constructor. More...
 
 ~BlockingServer () throw ()
 Destructor. More...
 
bool runServer () throw ()
 
- Public Member Functions inherited from akg::GenericServer
 GenericServer () throw ()
 Default constructor. More...
 
virtual ~GenericServer () throw ()
 Destructor. More...
 
void shouldExit () throw ()
 Instructs the server to leave the loop (runServer()) More...
 
void setListenPort (int) throw ()
 Sets the listen port. More...
 
int getListenPort () throw ()
 Returns the listen port. More...
 
void setTimeout (int sec, int milisec) throw ()
 
void disableTimeout () throw ()
 Disables timeout, means wait unlimited. More...
 

Protected Member Functions

virtual void executeRequest (ServerSocket &)=0 throw ()
 
virtual void executeTimeout ()=0 throw ()
 
- Protected Member Functions inherited from akg::GenericServer
bool initListenSocket (int port, bool nonblocking) throw ()
 Init the listen socket. More...
 
bool connectNewClient (ServerSocket &) throw ()
 
void closeSocket (Socket &) throw ()
 

Additional Inherited Members

- Protected Attributes inherited from akg::GenericServer
ListenSocket listenSocket
 
int listenPort
 
Selector selector
 
bool exitRequest
 

Detailed Description

Base class for a simple blocking server, capable of dealing with a single client. Don't use except for very simple cases. This version doesn't care much about errors

Constructor & Destructor Documentation

akg::BlockingServer::BlockingServer ( )
throw (
)

Default constructor.

akg::BlockingServer::~BlockingServer ( )
throw (
)

Destructor.

Member Function Documentation

virtual void akg::BlockingServer::executeRequest ( ServerSocket )
throw (
)
protectedpure virtual

Pure function to process the request. It has to read, process and write the answer, because afterwards the socket is closed. Don't throw!

virtual void akg::BlockingServer::executeTimeout ( )
throw (
)
protectedpure virtual

Pure function to execute on timeout. Don't throw!

bool akg::BlockingServer::runServer ( )
throw (
)
virtual

runs the server. Accepts only one connection and blocks until the request is done

Implements akg::GenericServer.


The documentation for this class was generated from the following file: