2017-07-20 08:01:46 -07:00
|
|
|
//
|
2017-07-24 09:42:36 -07:00
|
|
|
// Copyright (c) 2016-2017 Vinnie Falco (vinnie dot falco at gmail dot com)
|
2017-07-20 08:01:46 -07:00
|
|
|
//
|
|
|
|
// Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
//
|
2017-07-20 13:40:34 -07:00
|
|
|
// Official repository: https://github.com/boostorg/beast
|
|
|
|
//
|
2017-07-20 08:01:46 -07:00
|
|
|
|
2017-07-20 13:40:34 -07:00
|
|
|
#ifndef BOOST_BEAST_WEBSOCKET_IMPL_ERROR_IPP
|
|
|
|
#define BOOST_BEAST_WEBSOCKET_IMPL_ERROR_IPP
|
2017-07-20 08:01:46 -07:00
|
|
|
|
2016-10-04 18:00:11 -04:00
|
|
|
namespace boost {
|
2017-07-20 08:01:46 -07:00
|
|
|
namespace beast {
|
|
|
|
namespace websocket {
|
2016-10-04 18:00:11 -04:00
|
|
|
namespace detail {
|
|
|
|
|
2018-01-01 12:16:19 -08:00
|
|
|
template<class>
|
|
|
|
string_view
|
|
|
|
error_codes::
|
|
|
|
get_message(error ev) const
|
2016-10-04 18:00:11 -04:00
|
|
|
{
|
2018-01-01 12:16:19 -08:00
|
|
|
switch(ev)
|
2016-10-04 18:00:11 -04:00
|
|
|
{
|
2018-01-01 12:16:19 -08:00
|
|
|
default:
|
|
|
|
case error::failed: return "WebSocket connection failed due to a protocol violation";
|
|
|
|
case error::closed: return "WebSocket connection closed normally";
|
|
|
|
case error::handshake_failed: return "WebSocket upgrade handshake failed";
|
|
|
|
case error::buffer_overflow: return "WebSocket dynamic buffer overflow";
|
|
|
|
case error::partial_deflate_block: return "WebSocket partial deflate block";
|
2016-10-04 18:00:11 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} // detail
|
2017-07-20 08:01:46 -07:00
|
|
|
} // websocket
|
|
|
|
} // beast
|
2017-07-20 13:40:34 -07:00
|
|
|
} // boost
|
2017-07-20 08:01:46 -07:00
|
|
|
|
|
|
|
#endif
|