try {
while (ProcessMessage())
; /* empty loop body */
-
- Disconnect();
} catch (const std::exception& ex) {
Log(LogWarning, "ApiClient", "Error while reading JSON-RPC message for identity '" + m_Identity + "': " + DiagnosticInformation(ex));
}
+
+ Disconnect();
}
Value SetLogPositionHandler(const MessageOrigin& origin, const Dictionary::Ptr& params)
String host = endpoint->GetHost();
String port = endpoint->GetPort();
+ Log(LogWarning, "ApiClient", "Reconnecting to API endpoint '" + endpoint->GetName() + "' via host '" + host + "' and port " + port);
+
TcpSocket::Ptr client = make_shared<TcpSocket>();
try {
#include "base/dynamictype.hpp"
#include "base/utility.hpp"
#include "base/exception.hpp"
+#include "base/convert.hpp"
#include <boost/foreach.hpp>
using namespace icinga;
{
boost::mutex::scoped_lock lock(m_ClientsLock);
m_Clients.erase(client);
+
+ Log(LogWarning, "ApiListener", "Removing API client for endpoint '" + GetName() + "'. " + Convert::ToString(m_Clients.size()) + " API clients left.");
}
bool is_master = ApiListener::GetInstance()->IsMaster();