| 111 | } |
| 112 | |
| 113 | uint64_t CCppNetImpl::SetTimer(uint32_t interval, const std::function<void(void*)>& func, void* param, bool always) { |
| 114 | |
| 115 | auto actions = _RandomGetActions(); |
| 116 | |
| 117 | uint64_t timer_id = 0; |
| 118 | timer_id = actions->AddTimerEvent(interval, func, param, always); |
| 119 | actions->WakeUp(); |
| 120 | |
| 121 | _timer_actions_map[timer_id] = actions; |
| 122 | |
| 123 | return timer_id; |
| 124 | } |
| 125 | |
| 126 | void CCppNetImpl::RemoveTimer(uint64_t timer_id) { |
| 127 | auto iter = _timer_actions_map.find(timer_id); |
nothing calls this directly
no test coverage detected