mirror of
https://github.com/Icinga/icinga2.git
synced 2025-07-20 12:14:44 +02:00
parent
7462c8320a
commit
aaa6154fd7
@ -163,7 +163,8 @@ void ApiListener::ListenerThreadProc(const Socket::Ptr& server)
|
||||
* @param node The remote host.
|
||||
* @param service The remote port.
|
||||
*/
|
||||
void ApiListener::AddConnection(const String& node, const String& service) {
|
||||
void ApiListener::AddConnection(const String& node, const String& service)
|
||||
{
|
||||
{
|
||||
ObjectLock olock(this);
|
||||
|
||||
@ -175,8 +176,16 @@ void ApiListener::AddConnection(const String& node, const String& service) {
|
||||
|
||||
TcpSocket::Ptr client = make_shared<TcpSocket>();
|
||||
|
||||
try {
|
||||
client->Connect(node, service);
|
||||
Utility::QueueAsyncCallback(boost::bind(&ApiListener::NewClientHandler, this, client, RoleClient));
|
||||
} catch (const std::exception& ex) {
|
||||
std::ostringstream info, debug;
|
||||
info << "Cannot connect to host '" << node << "' on port '" << service << "'.";
|
||||
debug << info << std::endl << DiagnosticInformation(ex);
|
||||
Log(LogCritical, "remote", info.str());
|
||||
Log(LogDebug, "remote", debug.str());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user