Gracefully shutdown Websocket and TLS streams

Summary:
Resolves #18
Ref T15241

Reviewers: ivica

Reviewed By: ivica

Subscribers: korina, miljen

Maniphest Tasks: T15241

Differential Revision: https://repo.mireo.local/D33395
This commit is contained in:
Bruno Iljazovic committed 2025-01-30 18:18:05 +01:00
1 parent 4df9dbbb07
commit 8b41f0dd4d
23 files changed
+460 -59

No files matched your search

+1 -2
View File
@@ -11,13 +11,12 @@
#ifdef BOOST_ASIO_HAS_CO_AWAIT
#include <boost/mqtt5.hpp>
#include <boost/mqtt5/websocket.hpp>
#include <boost/mqtt5/websocket_ssl.hpp>
#include <boost/asio/awaitable.hpp>
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ssl.hpp>
#include <boost/beast/websocket/ssl.hpp> // async_teardown for asio::ssl::socket
#include <boost/beast/websocket/stream.hpp>
#include <cstdint>
+1 -2
View File
@@ -8,7 +8,7 @@
#include <boost/mqtt5/logger.hpp>
#include <boost/mqtt5/logger_traits.hpp>
#include <boost/mqtt5/mqtt_client.hpp>
#include <boost/mqtt5/websocket.hpp>
#include <boost/mqtt5/websocket_ssl.hpp>
#include <boost/mqtt5/detail/log_invoke.hpp>
@@ -16,7 +16,6 @@
#include <boost/asio/io_context.hpp>
#include <boost/asio/ip/tcp.hpp>
#include <boost/asio/ssl/stream.hpp>
#include <boost/beast/ssl/ssl_stream.hpp> // async_teardown specialization for websocket ssl stream
#include <boost/beast/websocket/stream.hpp>
#include <boost/test/tools/output_test_stream.hpp>
#include <boost/test/unit_test.hpp>
+5
View File
@@ -84,6 +84,11 @@ struct test_tcp_stream : public test::test_stream {
}
};
template <typename ShutdownHandler>
void async_shutdown(test_tcp_stream&, ShutdownHandler&& handler) {
return std::move(handler)(error_code {});
}
using underlying_stream = test_tcp_stream;
using stream_context = detail::stream_context<underlying_stream, std::monostate>;
using astream = test::test_autoconnect_stream<underlying_stream, stream_context>;