diff options
author | luigi1111 <luigi1111w@gmail.com> | 2018-06-25 15:12:37 -0500 |
---|---|---|
committer | luigi1111 <luigi1111w@gmail.com> | 2018-06-25 15:12:37 -0500 |
commit | 8fad35f8e2b21e90ee9f444861d2294a2f8a3e2e (patch) | |
tree | 108619f19a942abcd0c462efed40907e8045fd23 /contrib/epee/include/net/abstract_tcp_server2.h | |
parent | Merge pull request #3957 (diff) | |
parent | epee: adaptive connection timeout system (diff) | |
download | monero-8fad35f8e2b21e90ee9f444861d2294a2f8a3e2e.tar.xz |
Merge pull request #3962
55c7fb8 epee: adaptive connection timeout system (moneromooo-monero)
Diffstat (limited to 'contrib/epee/include/net/abstract_tcp_server2.h')
-rw-r--r-- | contrib/epee/include/net/abstract_tcp_server2.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h index 2f7325be5..7ca6ac872 100644 --- a/contrib/epee/include/net/abstract_tcp_server2.h +++ b/contrib/epee/include/net/abstract_tcp_server2.h @@ -119,6 +119,7 @@ namespace net_utils //----------------- i_service_endpoint --------------------- virtual bool do_send(const void* ptr, size_t cb); ///< (see do_send from i_service_endpoint) virtual bool do_send_chunk(const void* ptr, size_t cb); ///< will send (or queue) a part of data + virtual bool send_done(); virtual bool close(); virtual bool call_run_once_service_io(); virtual bool request_callback(); @@ -137,8 +138,11 @@ namespace net_utils /// reset connection timeout timer and callback void reset_timer(boost::posix_time::milliseconds ms, bool add); - boost::posix_time::milliseconds get_default_time() const; - boost::posix_time::milliseconds get_timeout_from_bytes_read(size_t bytes) const; + boost::posix_time::milliseconds get_default_timeout(); + boost::posix_time::milliseconds get_timeout_from_bytes_read(size_t bytes); + + /// host connection count tracking + unsigned int host_count(const std::string &host, int delta = 0); /// Buffer for incoming data. boost::array<char, 8192> buffer_; @@ -165,6 +169,8 @@ namespace net_utils boost::asio::deadline_timer m_timer; bool m_local; + bool m_ready_to_close; + std::string m_host; public: void setRpcStation(); |