Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions include/crow/socket_adaptors.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@
#include <boost/asio/ssl.hpp>
#endif
#include "crow/settings.h"


#if BOOST_VERSION >= 107000
#define GET_IO_SERVICE(s) ((boost::asio::io_context &)(s).get_executor().context())
#else
#define GET_IO_SERVICE(s) ((s).get_io_service())
#endif

namespace crow
{
using namespace boost;
Expand All @@ -19,7 +27,7 @@ namespace crow

boost::asio::io_service& get_io_service()
{
return socket_.get_io_service();
return GET_IO_SERVICE(socket_);
}

tcp::socket& raw_socket()
Expand Down Expand Up @@ -96,7 +104,7 @@ namespace crow

boost::asio::io_service& get_io_service()
{
return raw_socket().get_io_service();
return GET_IO_SERVICE(raw_socket());
}

template <typename F>
Expand Down