diff options
| author | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-02 19:18:27 +0000 |
|---|---|---|
| committer | Sascha Volkenandt <sascha (at) akv-soft (dot) de> | 2007-01-02 19:18:27 +0000 |
| commit | 48c46dfdd986ad4a7a0692d05992f7882bef6a88 (patch) | |
| tree | 88a3a88a7ab43632850569cba3ab48a1924d9e52 /thread.cpp | |
| download | vdr-plugin-live-48c46dfdd986ad4a7a0692d05992f7882bef6a88.tar.gz vdr-plugin-live-48c46dfdd986ad4a7a0692d05992f7882bef6a88.tar.bz2 | |
- initial checkin
Diffstat (limited to 'thread.cpp')
| -rw-r--r-- | thread.cpp | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/thread.cpp b/thread.cpp new file mode 100644 index 0000000..df6580c --- /dev/null +++ b/thread.cpp @@ -0,0 +1,40 @@ +#include <cstdlib> +#include <iostream> +#include <stdexcept> +#include <tnt/tntnet.h> +#include <vdr/plugin.h> +#include "thread.h" +#include "tntconfig.h" + +namespace vdrlive { + +using namespace std; +using namespace tnt; + +ServerThread::ServerThread(): + m_configPath( 0 ) +{ +} + +ServerThread::~ServerThread() +{ + free( m_configPath ); +} + +void ServerThread::Action() +{ + try { + m_configPath = strdup( TntConfig::Get().GetConfigPath().c_str() ); + + char* argv[] = { "tntnet", "-c", m_configPath }; + int argc = sizeof( argv ) / sizeof( argv[0] ); + Tntnet app( argc, argv ); + app.run(); + } catch ( exception const& ex ) { + // XXX move initial error handling to live.cpp + esyslog( "ERROR: live httpd server crashed: %s", ex.what() ); + cerr << "HTTPD FATAL ERROR: " << ex.what() << endl; + } +} + +} // namespace vdrlive |
