constant.hpp 856 B

1234567891011121314151617181920212223242526272829
  1. // Copyright Takatoshi Kondo 2020
  2. //
  3. // Distributed under the Boost Software License, Version 1.0.
  4. // (See accompanying file LICENSE_1_0.txt or copy at
  5. // http://www.boost.org/LICENSE_1_0.txt)
  6. #if !defined(MQTT_CONSTANT_HPP)
  7. #define MQTT_CONSTANT_HPP
  8. #include <cstddef>
  9. #include <chrono>
  10. #include <mqtt/namespace.hpp>
  11. #include <mqtt/type.hpp>
  12. namespace MQTT_NS {
  13. static constexpr session_expiry_interval_t session_never_expire = 0xffffffffUL;
  14. static constexpr topic_alias_t topic_alias_max = 0xffff;
  15. static constexpr std::size_t packet_size_no_limit =
  16. 1 + // fixed header
  17. 4 + // remaining length
  18. 128 * 128 * 128 * 128; // maximum value of remainin length
  19. static constexpr receive_maximum_t receive_maximum_max = 0xffff;
  20. static constexpr auto shutdown_timeout = std::chrono::seconds(3);
  21. } // namespace MQTT_NS
  22. #endif // MQTT_CONSTANT_HPP