fix: support boost 1.87 (#5832)
Co-authored-by: Nerixyz <nerixdev@outlook.de>
This commit is contained in:
@@ -14,11 +14,10 @@ struct ActionUser;
|
||||
|
||||
// Create timer using given ioService
|
||||
template <typename Duration, typename Callback>
|
||||
void runAfter(boost::asio::io_service &ioService, Duration duration,
|
||||
Callback cb)
|
||||
void runAfter(boost::asio::io_context &ioc, Duration duration, Callback cb)
|
||||
{
|
||||
auto timer = std::make_shared<boost::asio::steady_timer>(ioService);
|
||||
timer->expires_from_now(duration);
|
||||
auto timer = std::make_shared<boost::asio::steady_timer>(ioc);
|
||||
timer->expires_after(duration);
|
||||
|
||||
timer->async_wait([timer, cb](const boost::system::error_code &ec) {
|
||||
if (ec)
|
||||
@@ -37,7 +36,7 @@ template <typename Duration, typename Callback>
|
||||
void runAfter(std::shared_ptr<boost::asio::steady_timer> timer,
|
||||
Duration duration, Callback cb)
|
||||
{
|
||||
timer->expires_from_now(duration);
|
||||
timer->expires_after(duration);
|
||||
|
||||
timer->async_wait([timer, cb](const boost::system::error_code &ec) {
|
||||
if (ec)
|
||||
|
||||
Reference in New Issue
Block a user