4 #include <boost/asio/executor_work_guard.hpp>
5 #include <boost/asio/io_context.hpp>
11 struct network_context
13 boost::asio::io_context context;
17 auto wg = boost::asio::make_work_guard(context);
18 #if defined(__cpp_exceptions)
23 catch(std::exception& e)
25 ossia::logger().error(
"Error while processing network events: {}", e.what());
29 ossia::logger().error(
"Error while processing network events.");
37 using network_context_ptr = std::shared_ptr<network_context>;
spdlog::logger & logger() noexcept
Where the errors will be logged. Default is stderr.
Definition: context.cpp:104