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

Method Disconnect

lib/remote/httpserverconnection.cpp:77–99  ·  view source on GitHub ↗

* Tries to asynchronously shut down the SSL stream and underlying socket. * * It is important to note that this method should only be called from within a coroutine that uses `m_IoStrand`. * * @param yc boost::asio::yield_context The coroutine yield context which you are calling this method from. */

Source from the content-addressed store, hash-verified

75 * @param yc boost::asio::yield_context The coroutine yield context which you are calling this method from.
76 */
77void HttpServerConnection::Disconnect(boost::asio::yield_context yc)
78{
79 namespace asio = boost::asio;
80
81 if (m_ShuttingDown) {
82 return;
83 }
84
85 m_ShuttingDown = true;
86
87 Log(LogInformation, "HttpServerConnection")
88 << "HTTP client disconnected (from " << m_PeerAddress << ")";
89
90 m_CheckLivenessTimer.cancel();
91
92 m_Stream->GracefulDisconnect(m_IoStrand, yc);
93
94 auto listener (ApiListener::GetInstance());
95
96 if (listener) {
97 listener->RemoveHttpClient(this);
98 }
99}
100
101/**
102 * Starts a coroutine that continually reads from the stream to detect a disconnect from the client.

Callers

nothing calls this directly

Calls 3

LogClass · 0.85
GracefulDisconnectMethod · 0.80
RemoveHttpClientMethod · 0.80

Tested by

no test coverage detected