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);
82 lib::aligned_storage<size>::type m_storage;
91template <
typename Handler>
99 template <
typename Arg1>
104 template <
typename Arg1,
typename Arg2>
106 handler_(arg1, arg2);
112 return this_handler->allocator_.
allocate(size);
127template <
typename Handler>
142template <
typename config>
145typedef lib::function<void (lib::asio::error_code
const & ec,
148typedef 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());
227template<>
struct is_error_code_enum<
websocketpp::transport::asio::error::value>
Concept for receiving events from GenericReader upon parsing. The functions return true if no error o...
Creates and manages connections associated with a WebSocket endpoint.
friend void asio_handler_deallocate(void *pointer, std::size_t, custom_alloc_handler< Handler > *this_handler)
friend void * asio_handler_allocate(std::size_t size, custom_alloc_handler< Handler > *this_handler)
void operator()(Arg1 arg1, Arg2 arg2)
custom_alloc_handler(handler_allocator &a, Handler h)
void operator()(Arg1 arg1)
Asio transport error category.
char const * name() const _WEBSOCKETPP_NOEXCEPT_TOKEN_
std::string message(int value) const
void deallocate(void *pointer)
void * allocate(std::size_t memsize)
#define _WEBSOCKETPP_NOEXCEPT_TOKEN_
lib::error_category const & get_category()
Get a reference to a static copy of the asio transport error category.
lib::error_code make_error_code(error::value e)
Create an error code with the given value and the asio transport category.
@ proxy_invalid
Invalid Proxy URI.
@ pass_through
there was an error in the underlying transport library
@ proxy_failed
The connection to the requested proxy server failed.
@ invalid_num_bytes
async_read_at_least call requested more bytes than buffer can store
@ invalid_host_service
Invalid host or service.
lib::function< void(lib::asio::error_code const &ec, size_t bytes_transferred)> async_write_handler
lib::function< void(lib::asio::error_code const &ec, size_t bytes_transferred)> async_read_handler
lib::function< void(lib::error_code const &ec)> pre_init_handler
custom_alloc_handler< Handler > make_custom_alloc_handler(handler_allocator &a, Handler h)
Namespace for the WebSocket++ project.
const GenericPointer< typename T::ValueType > & pointer
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_