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

Method AddClient

lib/remote/endpoint.cpp:56–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56void Endpoint::AddClient(const JsonRpcConnection::Ptr& client)
57{
58 bool was_master = ApiListener::GetInstance()->IsMaster();
59
60 {
61 std::unique_lock<std::mutex> lock(m_ClientsLock);
62 m_Clients.insert(client);
63 }
64
65 bool is_master = ApiListener::GetInstance()->IsMaster();
66
67 if (was_master != is_master)
68 ApiListener::OnMasterChanged(is_master);
69
70 OnConnected(this, client);
71}
72
73void Endpoint::RemoveClient(const JsonRpcConnection::Ptr& client)
74{

Callers 1

Calls 2

IsMasterMethod · 0.80
insertMethod · 0.45

Tested by

no test coverage detected