From cab72215aa4f074485370dca3b2b69ccd3da170c Mon Sep 17 00:00:00 2001 From: Peter Thorson Date: Thu, 15 Aug 2013 07:46:07 -0500 Subject: [PATCH] adds new close codes per IANA registry --- changelog.md | 1 + websocketpp/close.hpp | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 62bd65632a..2e1e913388 100644 --- a/changelog.md +++ b/changelog.md @@ -1,4 +1,5 @@ HEAD +- Adds new 1012 and 1013 close codes per IANA registry - Fix typo in .gitattributes file. Thank you jstarasov for reporting this. #280 - Add missing locale include. Thank you Toninoso for reporting this. #281 - Refactors `asio_transport` endpoint and adds full documentation and exception diff --git a/websocketpp/close.hpp b/websocketpp/close.hpp index 3df9007258..107b345d14 100644 --- a/websocketpp/close.hpp +++ b/websocketpp/close.hpp @@ -112,6 +112,16 @@ namespace status { /// fulfilling the request. static value const internal_endpoint_error = 1011; + /// Indicates that the service is restarted. A client may reconnect and if + /// if it chooses to do so, should reconnect using a randomized delay of + /// 5-30s + static value const service_restart = 1012; + + /// Indicates that the service is experiencing overload. A client should + /// only connect to a different IP (when there are multiple for the target) + /// or reconnect to the same IP upon user action. + static value const try_again_later = 1013; + /// An endpoint failed to perform a TLS handshake /** * Designated for use in applications expecting a status code to indicate @@ -133,7 +143,7 @@ namespace status { */ inline bool reserved(value code) { return ((code >= rsv_start && code <= rsv_end) || - code == 1004 || code == 1012 || code == 1013 || code == 1014); + code == 1004 || code == 1014); } /// First value in range that is always invalid on the wire