heartbeat correct

This commit is contained in:
Benjamin Sergeant
2019-01-25 16:11:39 -08:00
parent 75d01c0c11
commit 885d245afb
5 changed files with 56 additions and 18 deletions

View File

@ -122,6 +122,11 @@ namespace ix
int _heartBeatPeriod;
static const int kDefaultHeartBeatPeriod;
const static std::string kHeartBeatPingMessage;
mutable std::mutex _lastSendTimePointMutex;
std::chrono::time_point<std::chrono::steady_clock> _lastSendTimePoint;
// No data was send through the socket for longer that the hearbeat period
bool exceedSendHeartBeatTimeOut();
void sendOnSocket();
WebSocketSendInfo sendData(wsheader_type::opcode_type type,