| 1550 | } |
| 1551 | |
| 1552 | void 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 | |
| 1579 | CNetMgr* CNetMgr::_instance = NULL; |
| 1580 | CNetMgr* CNetMgr::Instance (void) |
no test coverage detected