1 #include "SessionListener.h"
3 namespace remote
{ namespace mcs
{
5 SessionListener::SessionListener(unsigned int port
)
7 openServerSocket( server
,
13 log("Listening for client connections on port %u.\n",port
);
16 SessionListener::~SessionListener()
18 sessionmapbyfd_t::iterator cI
;
20 for ( cI
= sessions
.begin(); cI
!= sessions
.end(); cI
++ )
22 cI
->second
->destroy(true);
26 void SessionListener::handleEvent(short events
)
28 // for now, just try to accept a client connection
29 struct sockaddr_in client
;
31 if ( events
& POLLIN
|| events
& POLLPRI
)
33 log("Accepting new client connection.\n");
35 new Session(nextClient(fd
,client
),sessions
);