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


C++ CUser::AddBytesWritten方法代码示例

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


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

示例1: while

CIRCNetwork::~CIRCNetwork() {
    if (m_pIRCSock) {
        CZNC::Get().GetManager().DelSockByAddr(m_pIRCSock);
        m_pIRCSock = nullptr;
    }

    // Delete clients
    while (!m_vClients.empty()) {
        CZNC::Get().GetManager().DelSockByAddr(m_vClients[0]);
    }
    m_vClients.clear();

    // Delete servers
    DelServers();

    // Delete modules (this unloads all modules)
    delete m_pModules;
    m_pModules = nullptr;

    // Delete Channels
    for (CChan* pChan : m_vChans) {
        delete pChan;
    }
    m_vChans.clear();

    // Delete Queries
    for (CQuery* pQuery : m_vQueries) {
        delete pQuery;
    }
    m_vQueries.clear();

    CUser* pUser = GetUser();
    SetUser(nullptr);

    // Make sure we are not in the connection queue
    CZNC::Get().GetConnectionQueue().remove(this);

    CZNC::Get().GetManager().DelCronByAddr(m_pPingTimer);
    CZNC::Get().GetManager().DelCronByAddr(m_pJoinTimer);

    if (pUser) {
        pUser->AddBytesRead(m_uBytesRead);
        pUser->AddBytesWritten(m_uBytesWritten);
    } else {
        CZNC::Get().AddBytesRead(m_uBytesRead);
        CZNC::Get().AddBytesWritten(m_uBytesWritten);
    }
}
开发者ID:badloop,项目名称:znc,代码行数:48,代码来源:IRCNetwork.cpp

示例2:

CSocket::~CSocket() {
	CUser *pUser = nullptr;

	// CWebSock could cause us to have a nullptr pointer here
	if (m_pModule) {
		pUser = m_pModule->GetUser();
		m_pModule->UnlinkSocket(this);
	}

	if (pUser && m_pModule && (m_pModule->GetType() != CModInfo::GlobalModule)) {
		pUser->AddBytesWritten(GetBytesWritten());
		pUser->AddBytesRead(GetBytesRead());
	} else {
		CZNC::Get().AddBytesWritten(GetBytesWritten());
		CZNC::Get().AddBytesRead(GetBytesRead());
	}
}
开发者ID:TuffLuck,项目名称:znc,代码行数:17,代码来源:Socket.cpp

示例3: GetSession

CWebSock::~CWebSock() {
	if (!m_spAuth.IsNull()) {
		m_spAuth->Invalidate();
	}

	// we have to account for traffic here because CSocket does
	// not have a valid CModule* pointer.
	CUser *pUser = GetSession()->GetUser();
	if (pUser) {
		pUser->AddBytesWritten(GetBytesWritten());
		pUser->AddBytesRead(GetBytesRead());
	} else {
		CZNC::Get().AddBytesWritten(GetBytesWritten());
		CZNC::Get().AddBytesRead(GetBytesRead());
	}

	// bytes have been accounted for, so make sure they don't get again:
	ResetBytesWritten();
	ResetBytesRead();
}
开发者ID:notry4n,项目名称:znc,代码行数:20,代码来源:WebModules.cpp

示例4: if

CSocket::~CSocket() {
	CUser *pUser = nullptr;
	CIRCNetwork* pNetwork = nullptr;

	// CWebSock could cause us to have a nullptr pointer here
	if (m_pModule) {
		pUser = m_pModule->GetUser();
		pNetwork = m_pModule->GetNetwork();
		m_pModule->UnlinkSocket(this);
	}

	if (pNetwork && m_pModule && (m_pModule->GetType() == CModInfo::NetworkModule)) {
		pNetwork->AddBytesWritten(GetBytesWritten());
		pNetwork->AddBytesRead(GetBytesRead());
	} else if (pUser && m_pModule && (m_pModule->GetType() == CModInfo::UserModule)) {
		pUser->AddBytesWritten(GetBytesWritten());
		pUser->AddBytesRead(GetBytesRead());
	} else {
		CZNC::Get().AddBytesWritten(GetBytesWritten());
		CZNC::Get().AddBytesRead(GetBytesRead());
	}
}
开发者ID:BlaXpirit,项目名称:znc,代码行数:22,代码来源:Socket.cpp


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