From 312c13f4f6b299a976787542869f96b1e66549cf Mon Sep 17 00:00:00 2001 From: chriszero Date: Thu, 5 Feb 2015 21:32:55 +0100 Subject: Plex remote support. Control via Plexapps (Android, IOS...) --- ControlServer.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'ControlServer.cpp') diff --git a/ControlServer.cpp b/ControlServer.cpp index c727e20..31363ae 100644 --- a/ControlServer.cpp +++ b/ControlServer.cpp @@ -3,20 +3,29 @@ namespace plexclient { -ControlServer::ControlServer() { +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::Start() { - // start the HTTPServer - m_pSrv->start(); -} -void ControlServer::Stop() { +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); + } +} + } -- cgit v1.2.3