* 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. */
| 75 | * @param yc boost::asio::yield_context The coroutine yield context which you are calling this method from. |
| 76 | */ |
| 77 | void 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. |
nothing calls this directly
no test coverage detected