diff options
author | Riccardo Spagni <ric@spagni.net> | 2019-03-04 21:33:48 +0200 |
---|---|---|
committer | Riccardo Spagni <ric@spagni.net> | 2019-03-04 21:33:48 +0200 |
commit | c83e80c2634f2c14fbd9fe4dbfb6a0abc2eb20ea (patch) | |
tree | 358b5bebfb8dd92a107d2d952772525274ca3244 /contrib/epee/include/net/abstract_tcp_server2.h | |
parent | Merge pull request #5160 (diff) | |
parent | Use io_service::work in epee tcp server (diff) | |
download | monero-c83e80c2634f2c14fbd9fe4dbfb6a0abc2eb20ea.tar.xz |
Merge pull request #5162
4d3b61a3 Use io_service::work in epee tcp server (Lee Clagett)
Diffstat (limited to 'contrib/epee/include/net/abstract_tcp_server2.h')
-rw-r--r-- | contrib/epee/include/net/abstract_tcp_server2.h | 11 |
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 643b93b87..76773192e 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.h +++ b/contrib/epee/include/net/abstract_tcp_server2.h @@ -347,7 +347,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. |