mirror of
https://github.com/XRPLF/rippled.git
synced 2026-04-29 15:37:57 +00:00
removes internal connection tracking mechanism from endpoint
This commit is contained in:
@@ -397,7 +397,6 @@ public:
|
||||
}
|
||||
protected:
|
||||
connection_ptr create_connection();
|
||||
void remove_connection(connection_ptr con);
|
||||
|
||||
alog_type m_alog;
|
||||
elog_type m_elog;
|
||||
@@ -418,9 +417,6 @@ private:
|
||||
|
||||
rng_type m_rng;
|
||||
|
||||
// endpoint resources
|
||||
std::set<connection_ptr> m_connections;
|
||||
|
||||
// static settings
|
||||
bool const m_is_server;
|
||||
|
||||
|
||||
@@ -50,9 +50,6 @@ endpoint<connection,config>::create_connection() {
|
||||
// Cast that weak pointer to void* and manage it using another shared_ptr
|
||||
// connection_hdl hdl(reinterpret_cast<void*>(new connection_weak_ptr(con)));
|
||||
|
||||
// con->set_handle(hdl);
|
||||
|
||||
//
|
||||
con->set_handle(w);
|
||||
|
||||
// Copy default handlers from the endpoint
|
||||
@@ -67,14 +64,6 @@ endpoint<connection,config>::create_connection() {
|
||||
con->set_validate_handler(m_validate_handler);
|
||||
con->set_message_handler(m_message_handler);
|
||||
|
||||
con->set_termination_handler(
|
||||
lib::bind(
|
||||
&type::remove_connection,
|
||||
this,
|
||||
lib::placeholders::_1
|
||||
)
|
||||
);
|
||||
|
||||
lib::error_code ec;
|
||||
|
||||
ec = transport_type::init(con);
|
||||
@@ -83,9 +72,6 @@ endpoint<connection,config>::create_connection() {
|
||||
return connection_ptr();
|
||||
}
|
||||
|
||||
scoped_lock_type lock(m_mutex);
|
||||
m_connections.insert(con);
|
||||
|
||||
return con;
|
||||
}
|
||||
|
||||
@@ -216,20 +202,6 @@ void endpoint<connection,config>::pong(connection_hdl hdl, std::string const &
|
||||
if (ec) { throw ec; }
|
||||
}
|
||||
|
||||
template <typename connection, typename config>
|
||||
void endpoint<connection,config>::remove_connection(connection_ptr con) {
|
||||
std::stringstream s;
|
||||
s << "remove_connection. New count: " << m_connections.size()-1;
|
||||
m_alog.write(log::alevel::devel,s.str());
|
||||
|
||||
scoped_lock_type lock(m_mutex);
|
||||
|
||||
// unregister the termination handler
|
||||
con->set_termination_handler(termination_handler());
|
||||
|
||||
m_connections.erase(con);
|
||||
}
|
||||
|
||||
} // namespace websocketpp
|
||||
|
||||
#endif // WEBSOCKETPP_ENDPOINT_IMPL_HPP
|
||||
|
||||
Reference in New Issue
Block a user