From 80d361c795779d1f2c8ff9186c0b6f906d8cf3ec Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 16 Aug 2017 15:41:34 +0100 Subject: abstract_tcp_server2: improve tracking/cancelling of early connections We don't actually need to keep them past the call to start, as this adds them to the config object list, and so they'll then be cancelled already when the stop signal arrives. This allows removing the periodic call to cleanup connections. --- contrib/epee/include/net/abstract_tcp_server2.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'contrib/epee/include/net/abstract_tcp_server2.h') diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h index ca58d5467..03f143fe4 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.h +++ b/contrib/epee/include/net/abstract_tcp_server2.h @@ -281,8 +281,6 @@ namespace net_utils bool is_thread_worker(); - bool cleanup_connections(); - /// The io_service used to perform asynchronous operations. std::unique_ptr m_io_service_local_instance; boost::asio::io_service& io_service_; @@ -309,7 +307,7 @@ namespace net_utils connection_ptr new_connection_; boost::mutex connections_mutex; - std::deque> connections_; + std::set connections_; }; // class <>boosted_tcp_server -- cgit v1.2.3