Skip to content

Commit

Permalink
fix use of incomplete io_service type
Browse files Browse the repository at this point in the history
  • Loading branch information
Arvid Norberg authored and arvidn committed Mar 30, 2018
1 parent 26c08bd commit 8905f8a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
21 changes: 11 additions & 10 deletions include/simulator/simulator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,7 @@ namespace sim
using reuse_address = boost::asio::socket_base::reuse_address;
#if BOOST_VERSION >= 106600
using executor_type = boost::asio::ip::tcp::socket::executor_type;

executor_type get_executor()
{
return m_io_service.get_executor();
}
executor_type get_executor();
#endif

// socket options
Expand Down Expand Up @@ -1171,11 +1167,7 @@ namespace sim

#if BOOST_VERSION >= 106600
using executor_type = boost::asio::io_service::executor_type;

executor_type get_executor()
{
return get_internal_service().get_executor();
}
executor_type get_executor();
#endif


Expand Down Expand Up @@ -1253,6 +1245,15 @@ namespace sim
bool m_stopped = false;
};

#if BOOST_VERSION >= 106600
template <typename Protocol>
typename socket_base<Protocol>::executor_type
socket_base<Protocol>::get_executor()
{
return m_io_service.get_executor();
}
#endif

template <typename Protocol>
route socket_base<Protocol>::get_incoming_route()
{
Expand Down
7 changes: 7 additions & 0 deletions src/io_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,13 @@ namespace sim { namespace asio {
assert(false);
}

#if BOOST_VERSION >= 106600
io_service::executor_type io_service::get_executor()
{
return get_internal_service().get_executor();
}
#endif

int io_service::get_path_mtu(const asio::ip::address& source, const asio::ip::address& dest) const
{
// TODO: it would be nice to actually traverse the virtual network nodes
Expand Down

0 comments on commit 8905f8a

Please sign in to comment.