本文整理汇总了C++中Transfer::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ Transfer::Close方法的具体用法?C++ Transfer::Close怎么用?C++ Transfer::Close使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Transfer
的用法示例。
在下文中一共展示了Transfer::Close方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Clear
void Transfers::Clear(BOOL force)
{
OpP2PList<Transfer> m_delete_list;
PROFILE(FALSE);
Transfer *connection = m_list.Begin();
while(connection != NULL)
{
if(force)
{
m_delete_list.AddLast(connection);
}
else if(connection->IsClosing())
{
m_delete_list.AddLast(connection);
}
connection = m_list.Next();
}
connection = m_delete_list.Begin();
while(connection != NULL)
{
if(force)
{
DEBUGTRACE8_RES(UNI_L("WITH FORCE DESTRUCTING P2PConnection 0x%08x, "), connection);
}
else if(connection->IsClosing())
{
if (connection->GetRefCount() == 0)
{
DEBUGTRACE8_RES(UNI_L("DESTRUCTING P2PConnection 0x%08x, "), connection);
}
else if(connection->CanDelete())
{
DEBUGTRACE8_RES(UNI_L("WITH FORCE DESTRUCTING P2PConnection 0x%08x, "), connection);
}
else
{
DEBUGTRACE8_RES(UNI_L("NOT DESTRUCTING P2PConnection 0x%08x, "), connection);
DEBUGTRACE8_RES(UNI_L("refcount: %d\n"), connection->GetRefCount());
connection = m_delete_list.Next();
continue;
}
}
m_list.RemoveItem(connection);
DEBUGTRACE8_RES(UNI_L("%d connections left\n"), m_list.GetCount());
connection->Close();
OP_DELETE(connection);
connection = m_delete_list.Next();
}
}