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

Method DisconnectInternal

lib/perfdata/gelfwriter.cpp:244–265  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242}
243
244void GelfWriter::DisconnectInternal()
245{
246 if (!GetConnected())
247 return;
248
249 if (m_Stream.first) {
250 boost::system::error_code ec;
251 m_Stream.first->next_layer().shutdown(ec);
252
253 // https://stackoverflow.com/a/25703699
254 // As long as the error code's category is not an SSL category, then the protocol was securely shutdown
255 if (ec.category() == boost::asio::error::get_ssl_category()) {
256 Log(LogCritical, "GelfWriter")
257 << "TLS shutdown with host '" << GetHost() << "' could not be done securely.";
258 }
259 } else if (m_Stream.second) {
260 m_Stream.second->close();
261 }
262
263 SetConnected(false);
264
265}
266
267void GelfWriter::CheckResultHandler(const Checkable::Ptr& checkable, const CheckResult::Ptr& cr)
268{

Callers

nothing calls this directly

Calls 2

LogClass · 0.85
closeMethod · 0.80

Tested by

no test coverage detected