| 166 | } |
| 167 | |
| 168 | bool Timer::WaitAsync() |
| 169 | { |
| 170 | auto self(this->shared_from_this()); |
| 171 | auto async_wait_handler = [this, self](const std::error_code& ec) |
| 172 | { |
| 173 | // Call the timer aborted handler |
| 174 | if (ec == asio::error::operation_aborted) |
| 175 | SendTimer(true); |
| 176 | |
| 177 | // Check for error |
| 178 | if (ec) |
| 179 | { |
| 180 | SendError(ec); |
| 181 | return; |
| 182 | } |
| 183 | |
| 184 | // Call the timer expired handler |
| 185 | SendTimer(false); |
| 186 | }; |
| 187 | if (_strand_required) |
| 188 | _timer.async_wait(bind_executor(_strand, async_wait_handler)); |
| 189 | else |
| 190 | _timer.async_wait(async_wait_handler); |
| 191 | |
| 192 | return true; |
| 193 | } |
| 194 | |
| 195 | bool Timer::WaitSync() |
| 196 | { |
no outgoing calls
no test coverage detected