config.hpp 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Copyright (c) 2017-2023 zhllxt
  3. *
  4. * author : zhllxt
  5. * email : 37792738@qq.com
  6. *
  7. * Distributed under the Boost Software License, Version 1.0. (See accompanying
  8. * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  9. */
  10. #ifndef __ASIO2_CONFIG_HPP__
  11. #define __ASIO2_CONFIG_HPP__
  12. #if defined(_MSC_VER) && (_MSC_VER >= 1200)
  13. #pragma once
  14. #endif // defined(_MSC_VER) && (_MSC_VER >= 1200)
  15. // Note : Version 2.6 and 2.7 only supports asio standalone, does not support boost::asio, because
  16. // boost::optional and other boost classes are used in boost::beast, while std::optional is
  17. // used in beast standalone. to make the two compatible, it requires too much work. so,
  18. // boost::asio is not supported for version 2.6 and 2.7.
  19. // But at version 2.8, it supports both asio standalone and boost::asio.
  20. // define this to use asio standalone and beast standalone, otherwise use boost::asio and boost::beast.
  21. #define ASIO2_HEADER_ONLY
  22. // If you want to use the ssl, you need to define ASIO2_ENABLE_SSL.
  23. // When use ssl,on windows need linker "libssl.lib;libcrypto.lib;Crypt32.lib;", on
  24. // linux need linker "ssl;crypto;", if link failed under gcc, try ":libssl.a;:libcrypto.a;"
  25. // ssl must be before crypto.
  26. //#define ASIO2_ENABLE_SSL
  27. // RPC component is using tcp dgram mode as the underlying communication support by default,
  28. // If you want to using websocket as the underlying communication support, turn on this macro.
  29. //#define ASIO2_USE_WEBSOCKET_RPC
  30. // Whether to detect the validity of UTF8 string of mqtt
  31. #define ASIO2_CHECK_UTF8
  32. // Whether called the timer callback when the timer is awaked with some error.
  33. // eg : stop_timer will awake the timer with error of asio::error::operation_aborted.
  34. //#define ASIO2_ENABLE_TIMER_CALLBACK_WHEN_ERROR
  35. // Define ASIO_NO_EXCEPTIONS to disable the exception. so when the exception occurs, you can
  36. // check the stack trace.
  37. // If the ASIO_NO_EXCEPTIONS is defined, you can impl the throw_exception function by youself,
  38. // see: /asio2/external/asio.hpp
  39. //#define ASIO_NO_EXCEPTIONS
  40. #endif // !__ASIO2_CONFIG_HPP__