aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include/net/abstract_tcp_server2.inl
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2019-03-04 21:33:48 +0200
committerRiccardo Spagni <ric@spagni.net>2019-03-04 21:33:48 +0200
commitc83e80c2634f2c14fbd9fe4dbfb6a0abc2eb20ea (patch)
tree358b5bebfb8dd92a107d2d952772525274ca3244 /contrib/epee/include/net/abstract_tcp_server2.inl
parentMerge pull request #5160 (diff)
parentUse io_service::work in epee tcp server (diff)
downloadmonero-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.inl')
-rw-r--r--contrib/epee/include/net/abstract_tcp_server2.inl9
1 files changed, 4 insertions, 5 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.inl b/contrib/epee/include/net/abstract_tcp_server2.inl
index 7a3abe9e9..39d6911e3 100644
--- a/contrib/epee/include/net/abstract_tcp_server2.inl
+++ b/contrib/epee/include/net/abstract_tcp_server2.inl
@@ -891,8 +891,8 @@ PRAGMA_WARNING_DISABLE_VS(4355)
template<class t_protocol_handler>
boosted_tcp_server<t_protocol_handler>::boosted_tcp_server( t_connection_type connection_type ) :
m_state(boost::make_shared<typename connection<t_protocol_handler>::shared_state>()),
- m_io_service_local_instance(new boost::asio::io_service()),
- io_service_(*m_io_service_local_instance.get()),
+ m_io_service_local_instance(new worker()),
+ io_service_(m_io_service_local_instance->io_service),
acceptor_(io_service_),
default_remote(),
m_stop_signal_sent(false), m_port(0),
@@ -1005,9 +1005,8 @@ POP_WARNINGS
{
try
{
- size_t cnt = io_service_.run();
- if (cnt == 0)
- misc_utils::sleep_no_w(1);
+ io_service_.run();
+ return true;
}
catch(const std::exception& ex)
{