MCPcopy Create free account
hub / github.com/Icinga/icinga2 / RemoveClient

Method RemoveClient

lib/remote/endpoint.cpp:73–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73void Endpoint::RemoveClient(const JsonRpcConnection::Ptr& client)
74{
75 bool was_master = ApiListener::GetInstance()->IsMaster();
76
77 {
78 std::unique_lock<std::mutex> lock(m_ClientsLock);
79 m_Clients.erase(client);
80
81 Log(LogInformation, "ApiListener")
82 << "Removing API client for endpoint '" << GetName() << "'. " << m_Clients.size() << " API clients left.";
83
84 SetConnecting(false);
85 }
86
87 bool is_master = ApiListener::GetInstance()->IsMaster();
88
89 if (was_master != is_master)
90 ApiListener::OnMasterChanged(is_master);
91
92 OnDisconnected(this, client);
93}
94
95std::set<JsonRpcConnection::Ptr> Endpoint::GetClients() const
96{

Callers 1

DisconnectMethod · 0.45

Calls 4

LogClass · 0.85
IsMasterMethod · 0.80
eraseMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected