Issue 22: Convert remaining code to use the log module
[remote/remote-mci.git] / mcs / SessionListener.h
blob898c2b1d7816e7af66a8056dc41856ff28ac8caa
1 #ifndef _SESSIONLISTENER_H_
2 #define _SESSIONLISTENER_H_
4 #include "tcputil.h"
5 #include "database.h"
6 #include "FileDescriptor.h"
7 #include "Session.h"
9 namespace remote { namespace mcs {
11 /** This class is responsible for opening a TCP socket and listening
12 * for new client connections (sessions).
13 **/
14 class SessionListener : public FileDescriptor
16 public:
17 /** Creates and starts a new SessionListener instance.
18 * \param port Port to use when listening for new client connections.
19 **/
20 SessionListener(unsigned int port);
21 /** Destructor **/
22 virtual ~SessionListener();
23 private:
24 /** Handles a new event on the current socket
25 * \param events Event descriptor.
26 **/
27 void handleEvent(short events);
28 /** Server socket **/
29 struct sockaddr_in server;
30 /** Map of currently active sessions **/
31 sessionmapbyfd_t sessions;
35 #endif