MCPcopy Create free account
hub / github.com/F-Stack/f-stack / FindCreateDest

Method FindCreateDest

adapter/micro_thread/mt_net.cpp:1673–1694  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1671}
1672
1673CDestLinks* CNetMgr::FindCreateDest(CDestLinks* key)
1674{
1675 CDestLinks* dest = this->FindDestLink(key);
1676 if (dest != NULL)
1677 {
1678 MTLOG_DEBUG("dest links reuse ok");
1679 return dest;
1680 }
1681
1682 dest = this->AllocDestLink();
1683 if (NULL == dest)
1684 {
1685 MTLOG_ERROR("dest links alloc failed, log it");
1686 return NULL;
1687 }
1688
1689 dest->CopyKeyInfo(key);
1690 dest->StartTimer();
1691 this->InsertDestLink(dest);
1692
1693 return dest;
1694}
1695
1696void CNetMgr::DeleteDestLink(CDestLinks* dst)
1697{

Callers 1

GetConnLinkMethod · 0.80

Calls 5

FindDestLinkMethod · 0.95
AllocDestLinkMethod · 0.95
InsertDestLinkMethod · 0.95
CopyKeyInfoMethod · 0.80
StartTimerMethod · 0.80

Tested by

no test coverage detected