do not hardcode server ports in unittest, get one dynamically with bind(0)
This commit is contained in:
@ -156,7 +156,9 @@ namespace ix
|
||||
_onCloseCallback = onCloseCallback;
|
||||
}
|
||||
|
||||
bool WebSocketTransport::exceedSendHeartBeatTimeOut()
|
||||
// Only consider send time points for that computation.
|
||||
// The receive time points is taken into account in Socket::poll (second parameter).
|
||||
bool WebSocketTransport::heartBeatPeriodExceeded()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(_lastSendTimePointMutex);
|
||||
auto now = std::chrono::steady_clock::now();
|
||||
@ -172,7 +174,7 @@ namespace ix
|
||||
// send for a duration exceeding our heart-beat period, send a
|
||||
// ping to the server.
|
||||
if (pollResult == PollResultType_Timeout &&
|
||||
exceedSendHeartBeatTimeOut())
|
||||
heartBeatPeriodExceeded())
|
||||
{
|
||||
std::stringstream ss;
|
||||
ss << kHeartBeatPingMessage << "::" << _heartBeatPeriod << "s";
|
||||
|
@ -126,7 +126,7 @@ namespace ix
|
||||
std::chrono::time_point<std::chrono::steady_clock> _lastSendTimePoint;
|
||||
|
||||
// No data was send through the socket for longer that the hearbeat period
|
||||
bool exceedSendHeartBeatTimeOut();
|
||||
bool heartBeatPeriodExceeded();
|
||||
|
||||
void sendOnSocket();
|
||||
WebSocketSendInfo sendData(wsheader_type::opcode_type type,
|
||||
|
Reference in New Issue
Block a user