WebSocket++
0.8.2
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>
41 namespace websocketpp {
56 typedef lib::function<lib::error_code(
connection_hdl, std::vector<transport::buffer>
const
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";
127 template<>
struct is_error_code_enum<websocketpp::transport::iostream::
error::
value>
129 static bool const value =
true;
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
#define _WEBSOCKETPP_NOEXCEPT_TOKEN_
lib::function< lib::error_code(connection_hdl)> shutdown_handler
@ double_read
async_read called while another async_read was in progress
@ invalid_num_bytes
async_read_at_least call requested more bytes than buffer can store
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
lib::function< lib::error_code(connection_hdl, std::vector< transport::buffer > const &bufs)> vector_write_handler
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
lib::error_category const & get_category()
Get a reference to a static copy of the iostream transport error category.
#define _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_
lib::error_code make_error_code(error::value e)
Get an error code with the given value and the iostream transport category.
iostream transport error category