summaryrefslogtreecommitdiffstats
path: root/Master/Masterarbeit/src/XorayaPluginExecutor/XorayaConnector.cpp
blob: 522ba1d9adf0eb8e0decacbc519c801f92d9368d (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*!
 * \file XorayaConnector.cpp
 * \author S. Eisenhauer
 * \date 27.10.2011
 * \brief Implementation of CXorayaConnector
 */

#include <exception>
#include <boost/thread.hpp>
#include <boost/asio.hpp>
#include "TcpServer.h"
#include "protocol.h"
#include "XorayaConnector.h"
#include "CPluginExecutor.h"
#include "global.h"

boost::asio::io_service g_xIoService;

CXorayaConnector::CXorayaConnector(const CXorayaConnector& other)
:m_pxExecutor(other.m_pxExecutor),m_xTcpServer(other.m_xTcpServer)
{
	DEBUG_PRINT("entry");
	DEBUG_PRINT("exit");
}

CXorayaConnector::CXorayaConnector(CPluginExecutor* pxExecutor,CTcpServer& xTcpServer)
:m_pxExecutor(pxExecutor),m_xTcpServer(xTcpServer)
{
	DEBUG_PRINT("entry");
	DEBUG_PRINT("exit");
}

CXorayaConnector::~CXorayaConnector(void)
{
    DEBUG_PRINT("entry");
    DEBUG_PRINT("exit");
}

void CXorayaConnector::operator()()
{
    try
    {
        g_xIoService.run();
        DEBUG_PRINT(" io service returned ");
    }
    catch(std::exception& e)
    {
        ERROR_PRINT("%s",e.what());
    }
    return;
}
void CXorayaConnector::vStop()
{
	g_xIoService.stop();
}
void CXorayaConnector::vUploadLogMessage(const tstLogMessage& stLogMsg)
{
//	DEBUG_PRINT("entry");
	m_xTcpServer.vUploadLogMessage(stLogMsg);
//	DEBUG_PRINT("exit");
}