summaryrefslogtreecommitdiff
path: root/ControlServer.cpp
blob: 5344e449ef112e59de8dd8e2988c7b7e04dc2bb7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "ControlServer.h"

namespace plexclient {

    ControlServer::ControlServer() {
        m_pSvs = new Poco::Net::ServerSocket(3200);;
        m_pSrv = new Poco::Net::HTTPServer(new PlexReqHandlerFactory, *m_pSvs, new Poco::Net::HTTPServerParams);
    }

    void ControlServer::Stop() {
        Cancel(1);
        // Stop the HTTPServer
        m_pSrv->stop();
    }

    void ControlServer::Action() {
        isyslog("[plex] Starting Controlserver...");
        // start the HTTPServer
        m_pSrv->start();
        while (Running()) {
            SubscriptionManager::GetInstance().Notify();
            cCondWait::SleepMs(1000);
        }
    }


}