コード例 #1
0
ファイル: FullSnapClient.cpp プロジェクト: zhangchuhu/s2s
JobStatus FullSnapJob::onMessage(const Message &msg)
{
	LogTrace(Debug,"Metahod Entry, msgId = %d", msg.msgId);
	JobStatus ret = JOBSTOP;
	switch(msg.msgId)
	{
		case DNS:
			//impxxx set client conn factory
			LogTrace(Notice, "dsn result, %d", msg.shortArg );
			if(msg.longArg != 0)
			{
				std::vector<std::string>* ipv = (std::vector<std::string>*)msg.longArg;
				cli->ipListFromDns.swap(*ipv);
				delete ipv;
				ret = doReconnect();
			}
			else
			{
				LogTrace(Error, "Dns failure, get no host");
			}
			break;
		default:
			{
				LogTrace(Error, "invalid msgId = %d", msg.msgId);
			}
	}
	
	return ret;
}
コード例 #2
0
void TreeButton::setError(QString error)
{
    this->setText(QObject::tr("Connect"));
    this->getParentItem()->setText(4, QLatin1String ("4"));
    this->state= 4;
    bool makeReconnect (false);
    QColor bg("#FF0000"); // rot

    if (error == QLatin1String("1025")) {
        if (!Settings::getInstance()->getIsAutoReconnect()) {
            goto endjump;
        } else {
            error = QObject::tr("Process unexpected closed! Reconnect!");
            makeReconnect = true;
        }
    }
    this->getParentItemCast()->getOpenVPN()->setIsError(true);
    this->getParentItemCast()->getOpenVPN()->setErrorString(error);
    this->getParentItem()->setText(2, QObject::tr("An error has occurred.") + QLatin1String ("\n") + error);
    this->getParentItem()->setToolTip(2, QObject::tr("An error has occurred.") + QLatin1String ("\n") + error);
    this->getParentItem()->setBackgroundColor(1, bg);
    this->getParentItem()->setBackgroundColor(2, bg);
    this->getParentItem()->setBackgroundColor(3, bg);

    if (makeReconnect) {
        QTimer::singleShot(500, this, SLOT(doReconnect()));
    }

    // Sprungmarke für Fehler 1025 und kein Reconnect
endjump: {}

    this->timer.stop();
}
コード例 #3
0
    void CloudReconnectWorker::processNotification( AbsOptCloudClientWorker::TypeId tId, const AbsOptCloudClientWorker::BufferType& data )
    {
      LOG_Debug(core, "Process event message type notification ...");
      IUccSessionListener::TypeId typeId(tId);

      // Here we need to verify if the notification correspond to uccReconnectRequest.
      if( typeId == gvr::communication::ucc::UccMessageCloudReconnect::GetTypeId() )
      {
        doReconnect(data);
      }
    }
コード例 #4
0
ファイル: FullSnapClient.cpp プロジェクト: zhangchuhu/s2s
int FullSnapJob::init(){
    LogTrace(Info, "node:%d full snap start target:%d", cli->nv->getGid(), targetNode);
	if(cli->cfg->isLocalDaemon())
	{
		pthread_t th;
		this->incRef();
		pthread_create(&th, NULL, asyncGetHostByName, this);		
	}
	else
	{
		doReconnect();
	}
//	ASYNC_CALL(SnapService, snapStart, &FullSnapJob::onStarted, sessionId, cli->nv->getGid(), targetNode);
	return 0;

}
コード例 #5
0
ファイル: FullSnapClient.cpp プロジェクト: zhangchuhu/s2s
JobStatus FullSnapJob::onStarted(bool bto, int res)
{	
	if(bto || res != 0){
		LogTrace(Warn, "time out or err, bto = %d, res = %d, mine = %d,targetNode = %d", bto, res, cli->nv->getGid(), targetNode);
		return doReconnect();
	}else{
		if(startCount >0)
		{
			LogTrace(Warn, "prev snap failure, truncate the DB");
			cli->mDao->truncate();
		}
		lastServerId = 0;
		step = SyncMetaData_C;
		startCount++;
		ASYNC_CALL(SnapService, getMetas, &FullSnapJob::onSyncData, infos, sessionId, lastServerId, 1000);
		return SYSDEFAULT;
	}
}