// // Copyright (c) 2025 Ivica Siladic, Bruno Iljazovic, Korina Simicevic // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_MQTT5_SHUTDOWN_HPP #define BOOST_MQTT5_SHUTDOWN_HPP #include namespace boost::mqtt5::detail { template void async_shutdown(Stream& /* stream */, ShutdownHandler&& /* handler */) { /* If you are trying to use beast::websocket::stream and/or OpenSSL and this goes off, you need to add an include for one of these * * * If you are trying to use mqtt_client with user-defined stream type, you must provide an overload of async_shutdown that is discoverable via argument-dependent lookup (ADL). */ static_assert(sizeof(Stream) == -1, "Unknown Stream type in async_shutdown."); } template void async_shutdown( asio::basic_stream_socket& socket, ShutdownHandler&& handler ) { boost::system::error_code ec; socket.shutdown(asio::socket_base::shutdown_both, ec); return std::move(handler)(ec); } } // end namespace boost::mqtt5::detail #endif // !BOOST_MQTT5_SHUTDOWN_HPP