Move stop() call from closeTty() to the only calling site needing it
[remote/remote-mci.git] / mcs / SessionListener.cc
blob13cc54e6722a1fb54565bd2303ebf2d920b348cd
1 #include "SessionListener.h"
3 namespace remote { namespace mcs {
5 SessionListener::SessionListener(unsigned int port)
6 : FileDescriptor(
7 openServerSocket( server,
8 port,
9 5,
10 5 )),
11 sessions()
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);