当前位置: 首页>>代码示例>>C++>>正文


C++ CIRCSock::GetTimeSinceLastDataTransaction方法代码示例

本文整理汇总了C++中CIRCSock::GetTimeSinceLastDataTransaction方法的典型用法代码示例。如果您正苦于以下问题:C++ CIRCSock::GetTimeSinceLastDataTransaction方法的具体用法?C++ CIRCSock::GetTimeSinceLastDataTransaction怎么用?C++ CIRCSock::GetTimeSinceLastDataTransaction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CIRCSock的用法示例。


在下文中一共展示了CIRCSock::GetTimeSinceLastDataTransaction方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RunJob

	virtual void RunJob() {
		vector<CIRCNetwork*> vNetworks = m_pUser->GetNetworks();

		for (size_t a = 0; a < vNetworks.size(); a++) {
			CIRCNetwork* pNetwork = vNetworks[a];
			CIRCSock* pIRCSock = pNetwork->GetIRCSock();

			if (pIRCSock && pIRCSock->GetTimeSinceLastDataTransaction() >= 270) {
				pIRCSock->PutIRC("PING :ZNC");
			}

			if (pNetwork->IsIRCConnected()) {
				pNetwork->JoinChans();
			}

			vector<CClient*>& vClients = pNetwork->GetClients();
			for (size_t b = 0; b < vClients.size(); b++) {
				CClient* pClient = vClients[b];

				if (pClient->GetTimeSinceLastDataTransaction() >= 270) {
					pClient->PutClient("PING :ZNC");
				}
			}
		}
	}
开发者ID:b3rend,项目名称:znc,代码行数:25,代码来源:User.cpp

示例2: RunJob

	void RunJob() override {
		CIRCSock* pIRCSock = m_pNetwork->GetIRCSock();

		if (pIRCSock && pIRCSock->GetTimeSinceLastDataTransaction() >= CIRCNetwork::PING_FREQUENCY) {
			pIRCSock->PutIRC("PING :ZNC");
		}

		const vector<CClient*>& vClients = m_pNetwork->GetClients();
		for (CClient* pClient : vClients) {
			if (pClient->GetTimeSinceLastDataTransaction() >= CIRCNetwork::PING_FREQUENCY) {
				pClient->PutClient("PING :ZNC");
			}
		}
	}
开发者ID:Hasimir,项目名称:znc,代码行数:14,代码来源:IRCNetwork.cpp

示例3: RunJob

	virtual void RunJob() {
		vector<CClient*>& vClients = m_pUser->GetClients();
		CIRCSock* pIRCSock = m_pUser->GetIRCSock();

		if (pIRCSock && pIRCSock->GetTimeSinceLastDataTransaction() >= 270) {
			pIRCSock->PutIRC("PING :ZNC");
		}

		for (size_t a = 0; a < vClients.size(); a++) {
			CClient* pClient = vClients[a];

			if (pClient->GetTimeSinceLastDataTransaction() >= 270) {
				pClient->PutClient("PING :ZNC");
			}
		}

		if (m_pUser->IsIRCConnected()) {
			m_pUser->JoinChans();
		}
	}
开发者ID:bpcampbe,项目名称:znc,代码行数:20,代码来源:User.cpp

示例4: RunJob

    void RunJob() override {
        CIRCSock* pIRCSock = m_pNetwork->GetIRCSock();
        auto uFrequency = m_pNetwork->GetUser()->GetPingFrequency();

        if (pIRCSock &&
            pIRCSock->GetTimeSinceLastDataTransaction() >= uFrequency) {
            pIRCSock->PutIRC("PING :ZNC");
        }

        const vector<CClient*>& vClients = m_pNetwork->GetClients();
        for (CClient* pClient : vClients) {
            if (pClient->GetTimeSinceLastDataTransaction() >= uFrequency) {
                pClient->PutClient("PING :ZNC");
            }
        }

        // Restart timer for the case if the period had changed. Usually this is
        // noop
        Start(m_pNetwork->GetUser()->GetPingSlack());
    }
开发者ID:torksrevol,项目名称:znc,代码行数:20,代码来源:IRCNetwork.cpp


注:本文中的CIRCSock::GetTimeSinceLastDataTransaction方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。