28 #ifndef WEBSOCKETPP_TRANSPORT_IOSTREAM_BASE_HPP
29 #define WEBSOCKETPP_TRANSPORT_IOSTREAM_BASE_HPP
31 #include <websocketpp/common/system_error.hpp>
32 #include <websocketpp/common/cpp11.hpp>
33 #include <websocketpp/common/functional.hpp>
34 #include <websocketpp/common/connection_hdl.hpp>
44 typedef lib::function<lib::error_code(connection_hdl, char const *, size_t)>
77 char const * name()
const _WEBSOCKETPP_NOEXCEPT_TOKEN_ {
78 return "websocketpp.transport.iostream";
81 std::string message(
int value)
const {
84 return "Generic iostream transport policy error";
86 return "async_read_at_least call requested more bytes than buffer can store";
88 return "Async read already in progress";
90 return "An output stream to be set before async_write can be used";
92 return "A stream operation returned ios::bad";
107 return lib::error_code(static_cast<int>(e),
get_category());
114 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_
117 static bool const value =
true;
119 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
121 #endif // WEBSOCKETPP_TRANSPORT_IOSTREAM_BASE_HPP
uint16_t value
The type of a close code value.
lib::error_code make_error_code(error::value e)
Get an error code with the given value and the iostream transport category.
async_read called while another async_read was in progress
lib::error_category const & get_category()
Get a reference to a static copy of the iostream transport error category.
lib::function< lib::error_code(connection_hdl)> shutdown_handler
async_read_at_least call requested more bytes than buffer can store
Namespace for the WebSocket++ project.
iostream transport error category
lib::function< lib::error_code(connection_hdl, char const *, size_t)> write_handler
The type and signature of the callback used by iostream transport to write.