WebSocket++
0.8.3-dev
C++ websocket client/server library
|
28 #ifndef WEBSOCKETPP_TRANSPORT_BASE_CON_HPP
29 #define WEBSOCKETPP_TRANSPORT_BASE_CON_HPP
31 #include <websocketpp/common/cpp11.hpp>
32 #include <websocketpp/common/connection_hdl.hpp>
33 #include <websocketpp/common/functional.hpp>
34 #include <websocketpp/common/system_error.hpp>
139 buffer(
char const * b, size_t l) : buf(b),len(l) {}
183 class category :
public lib::error_category {
187 char const * name()
const _WEBSOCKETPP_NOEXCEPT_TOKEN_ {
188 return "websocketpp.transport";
191 std::string message(
int value)
const {
194 return "Generic transport policy error";
196 return "Underlying Transport Error";
197 case invalid_num_bytes:
198 return "async_read_at_least call requested more bytes than buffer can store";
199 case operation_aborted:
200 return "The operation was aborted";
201 case operation_not_supported:
202 return "The operation is not supported by this transport";
204 return "End of File";
206 return "TLS Short Read";
208 return "Timer Expired";
209 case action_after_shutdown:
210 return "A transport action was requested after shutdown";
212 return "Generic TLS related error";
219 inline lib::error_category
const & get_category() {
220 static category instance;
224 inline lib::error_code make_error_code(error::value e) {
225 return lib::error_code(
static_cast<
int>(e), get_category());
231 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_START_
232 template<>
struct is_error_code_enum<websocketpp::transport::error::value>
234 static bool const value =
true;
236 _WEBSOCKETPP_ERROR_CODE_ENUM_NS_END_
@ tls_short_read
TLS short read.
@ operation_not_supported
Operation not supported.
@ invalid_num_bytes
async_read_at_least call requested more bytes than buffer can store
lib::function< void(lib::error_code const &)> write_handler
The type and signature of the callback passed to the write method.
@ pass_through
underlying transport pass through
Generic transport related errors.
static std::vector< int > const versions_supported(helper, helper+4)
Container that stores the list of protocol versions supported.
lib::function< void(lib::error_code const &)> shutdown_handler
The type and signature of the callback passed to the shutdown method.
lib::function< void(lib::error_code const &, size_t)> read_handler
The type and signature of the callback passed to the read method.
lib::function< void()> dispatch_handler
The type and signature of the callback passed to the dispatch method.
@ operation_aborted
Operation aborted.
A simple utility buffer class.
@ action_after_shutdown
read or write after shutdown
@ double_read
async_read called while another async_read was in progress
lib::function< void(lib::error_code const &)> init_handler
The type and signature of the callback passed to the init hook.
@ tls_error
Other TLS error.
lib::function< void(lib::error_code const &)> timer_handler
The type and signature of the callback passed to the read method.