Пример #1
0
void GatewayMgr::start(QString password)
{
    g_sm->checkCurrentOn(ServiceMgr::LOGIC);

    // check
    if (mdsm_ != nullptr || tdsm_ != nullptr) {
        BfDebug("mdsm_!= nullptr || tdsm_ != nullptr");
        return;
    }

    // init mdsm
    password_ = password;

    if (!initMdSm()) {
        return;
    }

    if (!initTdSm()) {
        delete mdsm_;
        mdsm_ = nullptr;
        return;
    }

    startMdSm();
    startTdSm();
    return;
}
Пример #2
0
bool CtpMgr::start(QString password)
{
    // check
    if (mdsm_ != nullptr || tdsm_ != nullptr) {
        qFatal("mdsm_!= nullptr || tdsm_ != nullptr");
    }

    // init mdsm
    password_ = password;

    if (!initMdSm()) {
        return false;
    }

    if (!initTdSm()) {
        delete mdsm_;
        mdsm_ = nullptr;
        return false;
    }

    startMdSm();
    startTdSm();
    return true;
}