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

Method timer_notify

adapter/micro_thread/mt_net.cpp:1552–1577  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1550}
1551
1552void CDestLinks::timer_notify()
1553{
1554 uint64_t now = mt_time_ms();
1555 CSockLink* item = NULL;
1556 CSockLink* temp = NULL;
1557 TAILQ_FOREACH_SAFE(item, &_sock_list, _link_entry, temp)
1558 {
1559 if ((item->GetLastAccess() + this->_timeout) < now)
1560 {
1561 MTLOG_DEBUG("link timeout, last[%llu], now [%llu]", item->GetLastAccess(), now);
1562 item->Destroy();
1563 }
1564 }
1565
1566 item = TAILQ_FIRST(&_sock_list);
1567 if (NULL == item)
1568 {
1569 MTLOG_DEBUG("dest links timeout, now [%llu]", now);
1570 CNetMgr::Instance()->DeleteDestLink(this);
1571 return;
1572 }
1573
1574 this->StartTimer();
1575
1576 return;
1577}
1578
1579CNetMgr* CNetMgr::_instance = NULL;
1580CNetMgr* CNetMgr::Instance (void)

Callers 1

check_expiredMethod · 0.45

Calls 5

StartTimerMethod · 0.95
mt_time_msFunction · 0.85
GetLastAccessMethod · 0.80
DeleteDestLinkMethod · 0.80
DestroyMethod · 0.45

Tested by

no test coverage detected