WebSocket++
0.8.3-dev
C++ websocket client/server library
|
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>
36 #include <websocketpp/transport/base/connection.hpp>
85 class category :
public lib::error_category {
89 char const * name()
const _WEBSOCKETPP_NOEXCEPT_TOKEN_ {
90 return "websocketpp.transport.iostream";
93 std::string message(
int value)
const {
96 return "Generic iostream transport policy error";
97 case invalid_num_bytes:
98 return "async_read_at_least call requested more bytes than buffer can store";
100 return "Async read already in progress";
101 case output_stream_required:
102 return "An output stream to be set before async_write can be used";
104 return "A stream operation returned ios::bad";
113 static category instance;
119 return lib::error_code(
static_cast<
int>(e), get_category());
126 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_
127 template<>
struct is_error_code_enum<websocketpp::transport::iostream::error::value>
129 static bool const value =
true;
131 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
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.
iostream transport errors
lib::function< lib::error_code(connection_hdl)> shutdown_handler
@ double_read
async_read called while another async_read was in progress
static std::vector< int > const versions_supported(helper, helper+4)
Container that stores the list of protocol versions supported.
@ invalid_num_bytes
async_read_at_least call requested more bytes than buffer can store
lib::function< void()> dispatch_handler
The type and signature of the callback passed to the dispatch method.
Transport policy that uses STL iostream for I/O and does not support timers.
lib::function< lib::error_code(connection_hdl, std::vector< transport::buffer > const &bufs)> vector_write_handler
lib::error_category const & get_category()
Get a reference to a static copy of the iostream transport error category.
lib::error_code make_error_code(error::value e)
Get an error code with the given value and the iostream transport category.