diff options
author | bju <bju@maxi.fritz.box> | 2011-03-31 00:37:16 +0200 |
---|---|---|
committer | bju <bju@maxi.fritz.box> | 2011-03-31 00:37:16 +0200 |
commit | 32ba3fb9f2a1f7b073b3a121762385ac237a2af8 (patch) | |
tree | f3cbdbe2ced3e202d0c1cd3d037a8ed3108817e2 /vdr-vdrmanager/vdrmanagerthread.cpp | |
parent | acc1396153d7fb9c22d2b3cee3f2eef383ad681d (diff) | |
download | vdr-manager-32ba3fb9f2a1f7b073b3a121762385ac237a2af8.tar.gz vdr-manager-32ba3fb9f2a1f7b073b3a121762385ac237a2af8.tar.bz2 |
Renamed from androvdr to vdrmanager
Diffstat (limited to 'vdr-vdrmanager/vdrmanagerthread.cpp')
-rw-r--r-- | vdr-vdrmanager/vdrmanagerthread.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/vdr-vdrmanager/vdrmanagerthread.cpp b/vdr-vdrmanager/vdrmanagerthread.cpp new file mode 100644 index 0000000..fc72cf1 --- /dev/null +++ b/vdr-vdrmanager/vdrmanagerthread.cpp @@ -0,0 +1,62 @@ +/* + * VdrmonThread + */ +#include <string.h> +#include <vdr/plugin.h> +#include <vdr/thread.h> +#include "vdrmanagerthread.h" +#include "select.h" +#include "helpers.h" + +cAndroVdrThread::cAndroVdrThread(int port, const char * password) +{ + select = NULL; + this->port = port; + this->password = password; +} + +cAndroVdrThread::~cAndroVdrThread() +{ + Cleanup(); +} + +void cAndroVdrThread::Action(void) +{ + // create listener socket + if (!Init()) + return; + + // do processing + select->Action(); + + // cleanup + Cleanup(); +} + +bool cAndroVdrThread::Init() +{ + // create select + select = new cSelect(); + if (select == NULL) + return false; + + // create server socket + cVdrmanagerServerSocket * sock = new cVdrmanagerServerSocket(); + if (sock == NULL || !sock->Create(port, password)) + return false; + + // register server socket + select->SetServerSocket(sock); + + return true; +} + +void cAndroVdrThread::Cleanup() +{ + if (select) + delete select; +} + +void cAndroVdrThread::Shutdown() +{ +} |