Ejemplo n.º 1
0
QApplicationLauncher::QApplicationLauncher(QObject *parent) :
    AbstractServiceImplementation(parent),
    m_subscribeUri(""),
    m_commandUri(""),
    m_commandIdentity("launcher"),
    m_heartbeatPeriod(3000),
    m_connected(false),
    m_subscribeSocketState(Service::Down),
    m_commandSocketState(Service::Down),
    m_connectionState(Service::Disconnected),
    m_error(Service::NoError),
    m_errorString(""),
    m_launchers(QJsonValue(QJsonArray())),
    m_synced(false),
    m_context(NULL),
    m_subscribeSocket(NULL),
    m_commandSocket(NULL),
    m_commandHeartbeatTimer(new QTimer(this)),
    m_subscribeHeartbeatTimer(new QTimer(this)),
    m_commandPingOutstanding(false)
{
    connect(m_commandHeartbeatTimer, SIGNAL(timeout()),
            this, SLOT(commandHeartbeatTimerTick()));
    connect(m_subscribeHeartbeatTimer, SIGNAL(timeout()),
            this, SLOT(subscribeHeartbeatTimerTick()));

    initializeObject();
}
QApplicationCommand::QApplicationCommand(QObject *parent) :
    AbstractServiceImplementation(parent),
    m_commandUri(""),
    m_heartbeatPeriod(3000),
    m_connected(false),
    m_commandSocketState(Down),
    m_connectionState(Disconnected),
    m_error(NoError),
    m_errorString(""),
    m_context(NULL),
    m_commandSocket(NULL),
    m_commandHeartbeatTimer(new QTimer(this)),
    m_commandPingErrorCount(0),
    m_commandPingErrorThreshold(2)
{
    connect(m_commandHeartbeatTimer, SIGNAL(timeout()),
            this, SLOT(commandHeartbeatTimerTick()));
}