diff --git a/include/io_context/io_context.hpp b/include/io_context/io_context.hpp index d2f5770..340b684 100644 --- a/include/io_context/io_context.hpp +++ b/include/io_context/io_context.hpp @@ -66,7 +66,7 @@ class IoContext IoContext(const IoContext &) = delete; IoContext & operator=(const IoContext &) = delete; - asio::io_service & ios() const; + asio::io_context & ios() const; bool isServiceStopped(); uint32_t serviceThreadCount(); @@ -76,12 +76,12 @@ class IoContext template void post(F f) { - ios().post(f); + asio::post(ios(), f); } private: - std::shared_ptr m_ios; - std::shared_ptr m_work; + std::shared_ptr m_ios; + std::shared_ptr> m_work; std::shared_ptr m_ios_thread_workers; };