This commit is contained in:
Benjamin Sergeant
2018-11-14 15:52:28 -08:00
parent 54da891f79
commit c64bc20bb5
9 changed files with 92 additions and 97 deletions

View File

@ -15,6 +15,7 @@
#include <atomic>
#include "IXWebSocketTransport.h"
#include "IXWebSocketErrorInfo.h"
#include "IXWebSocketSendInfo.h"
#include "IXWebSocketPerMessageDeflateOptions.h"
#include "IXWebSocketHttpHeaders.h"
@ -40,30 +41,17 @@ namespace ix
WebSocket_MessageType_Pong = 5
};
struct WebSocketErrorInfo
{
uint64_t retries;
double wait_time;
int http_status;
std::string reason;
};
struct WebSocketCloseInfo
{
uint16_t code;
std::string reason;
WebSocketCloseInfo(uint64_t c, const std::string& r)
WebSocketCloseInfo(uint64_t c = 0,
const std::string& r = std::string())
{
code = c;
reason = r;
}
WebSocketCloseInfo()
{
code = 0;
reason = "";
}
};
using OnMessageCallback = std::function<void(WebSocketMessageType,