add methods to retrieve WebSocket close codes & reasons

This commit is contained in:
Peter Thorson
2013-06-08 16:22:19 -05:00
parent 0f02119d48
commit c86601f123

View File

@@ -775,6 +775,39 @@ public:
*/
session::state::value get_state() const;
/// Get the WebSocket close code sent by this endpoint.
/**
* @return The WebSocket close code sent by this endpoint.
*/
close::status::value get_local_close_code() const {
return m_local_close_code;
}
/// Get the WebSocket close reason sent by this endpoint.
/**
* @return The WebSocket close reason sent by this endpoint.
*/
std::string const & get_local_close_reason() const {
return m_local_close_reason;
}
/// Get the WebSocket close code sent by the remote endpoint.
/**
* @return The WebSocket close code sent by the remote endpoint.
*/
close::status::value get_remote_close_code() const {
return m_remote_close_code;
}
/// Get the WebSocket close reason sent by the remote endpoint.
/**
* @return The WebSocket close reason sent by the remote endpoint.
*/
std::string const & get_remote_close_reason() const {
return m_remote_close_reason;
}
/// Get the internal error code for a closed/failed connection
/**
* Retrieves a machine readable detailed error code indicating the reason