diff --git a/CMakeLists.txt b/CMakeLists.txt index d55a9560..04d3c58a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,7 +136,7 @@ endif() if(BUILD_SDK) find_package2(BUNDLED asio - VERSION 1.13.0 + VERSION 1.18.0 ) if(NOT asio_FOUND) build_bundled(asio extern/asio) diff --git a/extern/asio b/extern/asio index 90f32660..be7badc3 160000 --- a/extern/asio +++ b/extern/asio @@ -1 +1 @@ -Subproject commit 90f32660cd503494b3707840cfbd5434d8e9dabe +Subproject commit be7badc31abcc395cf868de6a1e240c2350bdbf2 diff --git a/fairmq/sdk/AsioAsyncOp.h b/fairmq/sdk/AsioAsyncOp.h index 4195ed8e..d5b60507 100644 --- a/fairmq/sdk/AsioAsyncOp.h +++ b/fairmq/sdk/AsioAsyncOp.h @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -69,17 +70,16 @@ struct AsioAsyncOpImpl : AsioAsyncOpImplBase throw RuntimeError("Async operation already completed"); } - GetEx2().dispatch( - [=, handler = std::move(fHandler)]() mutable { - try { - handler(ec, args...); - } catch (const std::exception& e) { - FAIR_LOG(error) << "Uncaught exception in AsioAsyncOp completion handler: " << e.what(); - } catch (...) { - FAIR_LOG(error) << "Unknown uncaught exception in AsioAsyncOp completion handler."; - } - }, - GetAlloc2()); + asio::dispatch(GetEx2(), + [=, handler = std::move(fHandler)]() mutable { + try { + handler(ec, args...); + } catch (const std::exception& e) { + FAIR_LOG(error) << "Uncaught exception in AsioAsyncOp completion handler: " << e.what(); + } catch (...) { + FAIR_LOG(error) << "Unknown uncaught exception in AsioAsyncOp completion handler."; + } + }); fWork1.reset(); fWork2.reset(); diff --git a/fairmq/sdk/AsioBase.h b/fairmq/sdk/AsioBase.h index 73203bf6..eee5e5ab 100644 --- a/fairmq/sdk/AsioBase.h +++ b/fairmq/sdk/AsioBase.h @@ -9,7 +9,7 @@ #ifndef FAIR_MQ_SDK_ASIOBASE_H #define FAIR_MQ_SDK_ASIOBASE_H -#include +#include #include #include #include @@ -18,7 +18,7 @@ namespace fair { namespace mq { namespace sdk { -using DefaultExecutor = asio::executor; +using DefaultExecutor = asio::any_io_executor; using DefaultAllocator = std::allocator; /**