Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext
boost::mqtt5::mqtt_client::connack_property

Retrieves the value of a specific property from the last CONNACK packet received.

Synopsis
template<
    prop::property_type p>
const auto&
connack_property(
    std::integral_constant< prop::property_type, p > prop) const;
Description

The return type varies according to the property requested. For all properties, the return type will be std::optional of their respective value type. For boost::mqtt5::prop::user_property, the return type is std::vector<std::pair<std::string, std::string>>.

Parameters

Name

Description

prop

The boost::mqtt5::connack_props property value to retrieve.

Example
std::optional<std::string> auth_method = client.connack_property(boost::mqtt5::prop::authentication_method); // ok
std::optional<std::string> c_type = client.connack_property(boost::mqtt5::prop::content_type); // does not compile, not a CONNACK prop!
See Also

See boost::mqtt5::connack_props for all eligible properties.


PrevUpHomeNext