void connection_oriented_network::on_client_session_disconnected(rpc_session_ptr& s) { int scount; bool r = false; { utils::auto_write_lock l(_clients_lock); auto it = _clients.find(s->remote_address()); if (it != _clients.end() && it->second.get() == s.get()) { _clients.erase(it); r = true; } scount = (int)_clients.size(); } if (r) { ddebug("client session %s disconnected (%d in total)", s->remote_address().to_string(), scount); } }
void connection_oriented_network::on_client_session_connected(rpc_session_ptr& s) { int scount = 0; bool r = false; { utils::auto_read_lock l(_clients_lock); auto it = _clients.find(s->remote_address()); if (it != _clients.end() && it->second.get() == s.get()) { r = true; } scount = (int)_clients.size(); } if (r) { ddebug("client session connected, remote_server = %s, current_count = %d", s->remote_address().to_string(), scount); } }