MainLoop Class Reference

Main class to manage client connections. More...

List of all members.

Public Member Functions

 MainLoop (const ClientFactory &clientFactory, ClientList &clients, size_t maxClients, AbstractClientDataHandler &clientDataHandler, AbstractSignalHandler &signalHandler, AbstractExecutorOutput &executorOutput, bool &terminationFlag)
 The constructor.
void run (const SocketList &sockets, sigset_t *sigMask)
 The main method to execute loop and handle data.


Detailed Description

This class manages clients connections and handles any data received from clients. It contains main select() system call to wait new data or new connections. This class has list of currently accepted clients and all clients will be closed on this classs destruction. It is not recommended to have two instances of this class because of behavior may depend on process signal handling.

Constructor & Destructor Documentation

MainLoop::MainLoop ( const ClientFactory clientFactory,
ClientList &  clients,
size_t  maxClients,
AbstractClientDataHandler clientDataHandler,
AbstractSignalHandler signalHandler,
AbstractExecutorOutput executorOutput,
bool &  terminationFlag 
) [inline]

Parameters:
[in] clientFactory The reference to a factory for new client object creation
[in] clients The list to store connected client set
[in] maxClients The maximum number of accepted clients (0 - not limited)
[in] clientDataHandler The reference to a object to handle data read from client connection
[in] signalHandler The reference to a object to handle registered signals
[in] executorOutput The reference to an object to provide information about executor output streams
[in] terminationFalg The reference to termination flag variable


Member Function Documentation

void MainLoop::run ( const SocketList &  sockets,
sigset_t *  sigMask 
)

Parameters:
[in] sockets The list of sockets objects to listen
[in] sigMask The sigmal mask to operate with


Generated on Thu May 6 16:10:58 2010 for VoiceMan by  doxygen 1.5.9