epee: adaptive connection timeout system

a connection's timeout is halved for every extra connection
from the same host.

Also keep track of when we don't need to use a connection
anymore, so we can close it and free the resource for another
connection.

Also use the longer timeout for non routable local addresses.
This commit is contained in:
moneromooo-monero 2018-06-07 12:43:10 +01:00
parent 8a7b3ff138
commit 55c7fb87a9
No known key found for this signature in database
GPG key ID: 686F07454D6CEFC3
6 changed files with 77 additions and 19 deletions

View file

@ -158,6 +158,7 @@ namespace
}
virtual bool close() { return true; }
virtual bool send_done() { return true; }
virtual bool call_run_once_service_io() { return true; }
virtual bool request_callback() { return true; }
virtual boost::asio::io_service& get_io_service() { return m_io_service; }