aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee/include
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/epee/include')
-rw-r--r--contrib/epee/include/net/abstract_tcp_server2.h6
-rwxr-xr-xcontrib/epee/include/net/http_server_impl_base.h5
2 files changed, 11 insertions, 0 deletions
diff --git a/contrib/epee/include/net/abstract_tcp_server2.h b/contrib/epee/include/net/abstract_tcp_server2.h
index 03f143fe4..33fec8ec5 100644
--- a/contrib/epee/include/net/abstract_tcp_server2.h
+++ b/contrib/epee/include/net/abstract_tcp_server2.h
@@ -213,6 +213,12 @@ namespace net_utils
int get_binded_port(){return m_port;}
+ long get_connections_count() const
+ {
+ auto connections_count = (m_sock_count > 0) ? (m_sock_count - 1) : 0; // Socket count minus listening socket
+ return connections_count;
+ }
+
boost::asio::io_service& get_io_service(){return io_service_;}
struct idle_callback_conext_base
diff --git a/contrib/epee/include/net/http_server_impl_base.h b/contrib/epee/include/net/http_server_impl_base.h
index 0788c6a4b..8b8e31b51 100755
--- a/contrib/epee/include/net/http_server_impl_base.h
+++ b/contrib/epee/include/net/http_server_impl_base.h
@@ -117,6 +117,11 @@ namespace epee
return m_net_server.get_binded_port();
}
+ long get_connections_count() const
+ {
+ return m_net_server.get_connections_count();
+ }
+
protected:
net_utils::boosted_tcp_server<net_utils::http::http_custom_handler<t_connection_context> > m_net_server;
};