blob: c31e6fa4801ba965512fe111a0407d379cb0d76e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
diff --git a/src/syncServer.cpp b/src/syncServer.cpp
index 1e6e352..5aeb197 100644
--- a/syncServer.cpp
+++ b/syncServer.cpp
@@ -48,6 +48,11 @@
#include "log.h"
#include "anytunError.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
//using asio::ip::tcp;
SyncServer::SyncServer(std::string localaddr, std::string port, ConnectCallback onConnect)
@@ -125,7 +130,7 @@ void SyncServer::start_accept()
std::list<AcceptorsElement>::iterator it = acceptors_.begin();
for(; it != acceptors_.end(); ++it) {
if(!it->started_) {
- SyncTcpConnection::pointer new_connection = SyncTcpConnection::create(it->acceptor_->get_io_service());
+ SyncTcpConnection::pointer new_connection = SyncTcpConnection::create(GET_IO_SERVICE(*it->acceptor_));
conns_.push_back(new_connection);
it->acceptor_->async_accept(new_connection->socket(),
boost::bind(&SyncServer::handle_accept, this, new_connection, boost::asio::placeholders::error, it));
|