11#if !defined(RESTINIO_USE_BOOST_ASIO)
18#define RESTINIO_ASIO_VERSION ASIO_VERSION
29 return ec == asio_ns::error::operation_aborted;
35 return ec == asio_ns::error::eof;
41 constexpr auto eof = asio_ns::error::eof;
50#define RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT ASIO_ERROR_CATEGORY_NOEXCEPT
54 #if defined(ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
56 #define RESTINIO_ASIO_HAS_WINDOWS_OVERLAPPED_PTR
62#include <boost/asio.hpp>
66#define RESTINIO_ASIO_VERSION BOOST_ASIO_VERSION
73 using namespace ::boost::asio;
74 using error_code = ::boost::system::error_code;
81 return ec == asio_ns::error::basic_errors::operation_aborted;
86 return ec == asio_ns::error::misc_errors::eof;
92 constexpr auto eof = asio_ns::error::misc_errors::eof;
94 inline const auto &
system_category() { return ::boost::system::system_category(); }
99 using error_category_base_t = ::boost::system::error_category;
102 #define RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT BOOST_SYSTEM_NOEXCEPT
106 #if defined(BOOST_ASIO_HAS_WINDOWS_OVERLAPPED_PTR)
108 #define RESTINIO_ASIO_HAS_WINDOWS_OVERLAPPED_PTR
172 result.assign(
"write operation was not" );
176 "write group destroyed without external notificato invokation" );
180 "a call to async_write() failed" );
184 "a call to async_read_some_at_call_failed() failed" );
198inline const error_category_base_t &
209inline asio_ns::error_code
221#if RESTINIO_ASIO_VERSION >= 101700
#define RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT
Error category for asio compatible error codes.
virtual std::string message(int value) const override
virtual const char * name() const RESTINIO_ERROR_CATEGORY_NAME_NOEXCEPT override
const auto & system_category()
run_on_this_thread_settings_t< Traits > on_this_thread()
A special marker for the case when http_server must be run on the context of the current thread.
asio_ns::error_category error_category_base_t
An alias for base class of error category entity.
bool error_is_operation_aborted(const asio_ns::error_code &ec) noexcept
asio_convertible_error_t
Enum for restinio errors that must presented as asio_ns::error_code value.
@ write_was_not_executed
After write notificator error: data was not sent, connection closed (or aborted) before a given piece...
@ async_read_some_at_call_failed
A call to async_read_some_at failed. The corresponding sendfile operation wasn't done.
@ write_group_destroyed_passively
After write notificator error: a notificator was set for a write_group_t but no external invokation h...
@ async_write_call_failed
A call to async_write failed. The corresponding write operation wasn't done.
bool error_is_eof(const asio_ns::error_code &ec) noexcept
asio_ns::error_code make_asio_compaible_error(asio_convertible_error_t err) noexcept
Make restinio error_code compatible with asio_ns::error_code.
const error_category_base_t & restinio_err_category()
Get restinio error category.
asio_ns::executor default_asio_executor