capture an error code and a reason when the server closes the connection

This commit is contained in:
Benjamin Sergeant
2018-10-25 18:51:19 -07:00
parent d5c8815438
commit bb0b1836cd
9 changed files with 149 additions and 74 deletions

View File

@ -53,7 +53,10 @@ namespace
log(std::string("Connecting to url: ") + _url);
_webSocket.setOnMessageCallback(
[this](ix::WebSocketMessageType messageType, const std::string& str, ix::WebSocketErrorInfo error)
[this](ix::WebSocketMessageType messageType,
const std::string& str,
const ix::WebSocketErrorInfo& error,
const ix::CloseInfo& closeInfo)
{
std::stringstream ss;
if (messageType == ix::WebSocket_MessageType_Open)