28 #ifndef WEBSOCKETPP_TRANSPORT_ASIO_BASE_HPP 29 #define WEBSOCKETPP_TRANSPORT_ASIO_BASE_HPP 54 static const size_t size = 1024;
58 #ifdef _WEBSOCKETPP_DEFAULT_DELETE_FUNCTIONS_ 64 if (!m_in_use && memsize < size) {
66 return static_cast<void*
>(&m_storage);
68 return ::operator
new(memsize);
73 if (pointer == &m_storage) {
76 ::operator
delete(pointer);
82 lib::aligned_storage<size>::type m_storage;
91 template <
typename Handler>
99 template <
typename Arg1>
104 template <
typename Arg1,
typename Arg2>
106 handler_(arg1, arg2);
112 return this_handler->allocator_.allocate(size);
118 this_handler->allocator_.deallocate(pointer);
127 template <
typename Handler>
142 template <
typename config>
145 typedef lib::function<void (lib::asio::error_code
const & ec,
148 typedef lib::function<void (lib::asio::error_code
const & ec,
187 return "websocketpp.transport.asio";
193 return "Generic asio transport policy error";
195 return "async_read_at_least call requested more bytes than buffer can store";
197 return "Underlying Transport Error";
199 return "Proxy connection failed";
201 return "Invalid proxy URI";
203 return "Invalid host or service";
218 return lib::error_code(static_cast<int>(e),
get_category());
232 #endif // WEBSOCKETPP_TRANSPORT_ASIO_HPP
Asio based endpoint transport component.
lib::error_code make_error_code(error::value e)
Get an error code with the given value and the stub transport category.
void deallocate(void *pointer)
#define _WEBSOCKETPP_NOEXCEPT_TOKEN_
span_CONFIG_SIZE_TYPE size_t
void operator()(Arg1 arg1)
std::string message(int value) const
async_read_at_least call requested more bytes than buffer can store
pass_through from underlying library
void * allocate(std::size_t memsize)
Asio transport error category.
lib::function< void(lib::error_code const &ec)> pre_init_handler
async_read_at_least call requested more bytes than buffer can store
friend void * asio_handler_allocate(std::size_t size, custom_alloc_handler< Handler > *this_handler)
there was an error in the underlying transport library
Namespace for the WebSocket++ project.
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_
lib::function< void(lib::asio::error_code const &ec, size_t bytes_transferred)> async_read_handler
void operator()(Arg1 arg1, Arg2 arg2)
friend void asio_handler_deallocate(void *pointer, std::size_t, custom_alloc_handler< Handler > *this_handler)
custom_alloc_handler< Handler > make_custom_alloc_handler(handler_allocator &a, Handler h)
The connection to the requested proxy server failed.
Catch-all error for transport policy errors that don't fit in other categories.
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
custom_alloc_handler(handler_allocator &a, Handler h)
lib::error_category const & get_category()
Get a reference to a static copy of the stub transport error category.
lib::function< void(lib::asio::error_code const &ec, size_t bytes_transferred)> async_write_handler
Catch-all error for transport policy errors that don't fit in other categories.
char const * name() const _WEBSOCKETPP_NOEXCEPT_TOKEN_