MCPcopy Create free account
hub / github.com/chronoxor/CppServer / WaitAsync

Method WaitAsync

source/server/asio/timer.cpp:168–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

166}
167
168bool 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
195bool Timer::WaitSync()
196{

Callers 4

SendRequestMethod · 0.80
SendRequestMethod · 0.80
test_timer.cppFile · 0.80
mainFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected