mirror of https://github.com/Icinga/icinga2.git
parent
7589c61b38
commit
9c5758958c
|
@ -62,7 +62,8 @@ void HttpClientConnection::Reconnect(void)
|
|||
/* m_Stream = new NetworkStream(socket);
|
||||
-- does not currently work because the NetworkStream class doesn't support async I/O */
|
||||
|
||||
m_Stream->RegisterDataHandler(boost::bind(&HttpClientConnection::DataAvailableHandler, this, _1));
|
||||
/* the stream holds an owning reference to this object through the callback we're registering here */
|
||||
m_Stream->RegisterDataHandler(boost::bind(&HttpClientConnection::DataAvailableHandler, HttpClientConnection::Ptr(this), _1));
|
||||
if (m_Stream->IsDataAvailable())
|
||||
DataAvailableHandler(m_Stream);
|
||||
}
|
||||
|
|
|
@ -55,7 +55,8 @@ void HttpServerConnection::StaticInitialize(void)
|
|||
|
||||
void HttpServerConnection::Start(void)
|
||||
{
|
||||
m_Stream->RegisterDataHandler(boost::bind(&HttpServerConnection::DataAvailableHandler, this));
|
||||
/* the stream holds an owning reference to this object through the callback we're registering here */
|
||||
m_Stream->RegisterDataHandler(boost::bind(&HttpServerConnection::DataAvailableHandler, HttpServerConnection::Ptr(this)));
|
||||
if (m_Stream->IsDataAvailable())
|
||||
DataAvailableHandler();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,8 @@ void JsonRpcConnection::StaticInitialize(void)
|
|||
|
||||
void JsonRpcConnection::Start(void)
|
||||
{
|
||||
m_Stream->RegisterDataHandler(boost::bind(&JsonRpcConnection::DataAvailableHandler, this));
|
||||
/* the stream holds an owning reference to this object through the callback we're registering here */
|
||||
m_Stream->RegisterDataHandler(boost::bind(&JsonRpcConnection::DataAvailableHandler, JsonRpcConnection::Ptr(this)));
|
||||
if (m_Stream->IsDataAvailable())
|
||||
DataAvailableHandler();
|
||||
}
|
||||
|
@ -103,7 +104,7 @@ void JsonRpcConnection::SendMessage(const Dictionary::Ptr& message)
|
|||
Log(LogWarning, "JsonRpcConnection")
|
||||
<< info.str() << "\n" << DiagnosticInformation(ex);
|
||||
|
||||
Utility::QueueAsyncCallback(boost::bind(&JsonRpcConnection::Disconnect, JsonRpcConnection::Ptr(this)));
|
||||
Disconnect();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue