rasdaman complete source
|
#include <akgnet_server.hh>
Public Member Functions | |
BlockingServer () throw () | |
Default constructor. More... | |
~BlockingServer () throw () | |
Destructor. More... | |
bool | runServer () throw () |
![]() | |
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 () |
![]() | |
bool | initListenSocket (int port, bool nonblocking) throw () |
Init the listen socket. More... | |
bool | connectNewClient (ServerSocket &) throw () |
void | closeSocket (Socket &) throw () |
Additional Inherited Members | |
![]() | |
ListenSocket | listenSocket |
int | listenPort |
Selector | selector |
bool | exitRequest |
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
akg::BlockingServer::BlockingServer | ( | ) | ||
throw | ( | |||
) |
Default constructor.
akg::BlockingServer::~BlockingServer | ( | ) | ||
throw | ( | |||
) |
Destructor.
|
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!
|
protectedpure virtual |
Pure function to execute on timeout. Don't throw!
|
virtual |
runs the server. Accepts only one connection and blocks until the request is done
Implements akg::GenericServer.