29 #ifndef WEBSOCKETPP_CLOSE_HPP
30 #define WEBSOCKETPP_CLOSE_HPP
36 #include <websocketpp/error.hpp>
37 #include <websocketpp/common/network.hpp>
38 #include <websocketpp/common/stdint.hpp>
39 #include <websocketpp/utf8_validator.hpp>
235 return "Normal close";
239 return "Protocol error";
240 case unsupported_data:
241 return "Unsupported data";
243 return "No status set";
245 return "Abnormal close";
246 case invalid_payload:
247 return "Invalid payload";
248 case policy_violation:
249 return "Policy violoation";
250 case message_too_big:
251 return "Message too big";
252 case extension_required:
253 return "Extension required";
254 case internal_endpoint_error:
255 return "Internal endpoint error";
256 case service_restart:
257 return "Service restart";
258 case try_again_later:
259 return "Try again later";
261 return "Bad gateway";
263 return "TLS handshake failure";
264 case subprotocol_error:
265 return "Generic subprotocol error";
266 case invalid_subprotocol_data:
267 return "Invalid subprotocol data";
297 ec = lib::error_code();
299 if (payload.size() == 0) {
301 }
else if (payload.size() == 1) {
308 val.c[0] = payload[0];
309 val.c[1] = payload[1];
337 ec = lib::error_code();
339 if (payload.size() > 2) {
340 reason.append(payload.begin()+2,payload.end());
343 if (!
websocketpp::utf8_validator::validate(reason)) {