aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/abstract_tcp_server2.h
diff options
context:
space:
mode:
authorLee Clagett <code@leeclagett.com>2019-02-10 13:40:32 -0500
committerLee Clagett <code@leeclagett.com>2019-02-10 13:40:32 -0500
commit4d3b61a31bf8b3ccb9ec78cf695e926964d8d82a (patch)
treea85269a6d075dee73a4af8ffe203dd3633f1ee96 /contrib/epee/include/net/abstract_tcp_server2.h
parentMerge pull request #4988 (diff)
downloadmonero-4d3b61a31bf8b3ccb9ec78cf695e926964d8d82a.tar.xz
Use io_service::work in epee tcp server
Diffstat (limited to 'contrib/epee/include/net/abstract_tcp_server2.h')
-rw-r--r--contrib/epee/include/net/abstract_tcp_server2.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h
index 37f4c782d..6f9e4db5b 100644
--- a/contrib/epee/include/net/abstract_tcp_server2.h
+++ b/contrib/epee/include/net/abstract_tcp_server2.h
@@ -330,7 +330,16 @@ namespace net_utils
const boost::shared_ptr<typename connection<t_protocol_handler>::shared_state> m_state;
/// The io_service used to perform asynchronous operations.
- std::unique_ptr<boost::asio::io_service> m_io_service_local_instance;
+ struct worker
+ {
+ worker()
+ : io_service(), work(io_service)
+ {}
+
+ boost::asio::io_service io_service;
+ boost::asio::io_service::work work;
+ };
+ std::unique_ptr<worker> m_io_service_local_instance;
boost::asio::io_service& io_service_;
/// Acceptor used to listen for incoming connections.