-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
service client connection state handling #1780
service client connection state handling #1780
Conversation
…connected (not only registered)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
std::lock_guard<std::mutex> const lock(m_client_map_sync); | ||
auto client = m_client_map.find(service.key); | ||
if (client != m_client_map.end()) | ||
auto& client_data = client.second; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto &client_data' can be declared as 'const auto &client_data' [readability-qualified-auto]
auto& client_data = client.second; | |
const auto& client_data = client.second; |
// check connections | ||
std::lock_guard<std::mutex> const lock(m_connected_services_map_sync); | ||
// lock client map | ||
std::lock_guard<std::mutex> lock(m_client_map_sync); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'lock' of type 'std::lock_guardstd::mutex' can be declared 'const' [misc-const-correctness]
std::lock_guard<std::mutex> lock(m_client_map_sync); | |
std::lock_guard<std::mutex> const lock(m_client_map_sync); |
{ | ||
// Lock mutex for iterating over client session map | ||
std::lock_guard<std::mutex> const client_map_lock(m_client_map_sync); | ||
auto& client_data = client.second; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto &client_data' can be declared as 'const auto &client_data' [readability-qualified-auto]
auto& client_data = client.second; | |
const auto& client_data = client.second; |
std::lock_guard<std::mutex> const lock(m_client_map_sync); | ||
auto client = m_client_map.find(iter.key); | ||
if (client == m_client_map.end()) | ||
auto& client_key = it->first; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: 'auto &client_key' can be declared as 'const auto &client_key' [readability-qualified-auto]
auto& client_key = it->first; | |
const auto& client_key = it->first; |
Description
Service client connection state (IsConnected) now handled correctly. Connection state is true if a matching server (at least one) is connected on lower client/service API level. We might change this API even more to return the states of all matching server.
Related issues
#1779
Cherry-pick to