minor cleanup
This commit is contained in:
parent
00ed1d2817
commit
2358b3ff26
@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
#include "IXConnectionState.h"
|
#include "IXConnectionState.h"
|
||||||
|
|
||||||
#include <sstream>
|
|
||||||
|
|
||||||
namespace ix
|
namespace ix
|
||||||
{
|
{
|
||||||
std::atomic<uint64_t> ConnectionState::_globalId(0);
|
std::atomic<uint64_t> ConnectionState::_globalId(0);
|
||||||
@ -19,9 +17,7 @@ namespace ix
|
|||||||
|
|
||||||
void ConnectionState::computeId()
|
void ConnectionState::computeId()
|
||||||
{
|
{
|
||||||
std::stringstream ss;
|
_id = std::to_string(_globalId++);
|
||||||
ss << _globalId++;
|
|
||||||
_id = ss.str();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::string& ConnectionState::getId() const
|
const std::string& ConnectionState::getId() const
|
||||||
|
@ -212,6 +212,10 @@ TEST_CASE("Websocket_heartbeat", "[heartbeat]")
|
|||||||
webSocketClientA.stop();
|
webSocketClientA.stop();
|
||||||
webSocketClientB.stop();
|
webSocketClientB.stop();
|
||||||
|
|
||||||
|
|
||||||
|
// Here we test heart beat period exceeded for clientA
|
||||||
|
// but it should not be exceeded for clientB which has sent data.
|
||||||
|
// -> expected ping messages == 2, but add a small buffer to make this more reliable.
|
||||||
REQUIRE(serverReceivedPingMessages >= 2);
|
REQUIRE(serverReceivedPingMessages >= 2);
|
||||||
REQUIRE(serverReceivedPingMessages <= 4);
|
REQUIRE(serverReceivedPingMessages <= 4);
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ class Command(object):
|
|||||||
thread.join(timeout)
|
thread.join(timeout)
|
||||||
|
|
||||||
if thread.is_alive():
|
if thread.is_alive():
|
||||||
print 'Command timeout, kill it: ' + self.cmd
|
print('Command timeout, kill it: ' + self.cmd)
|
||||||
self.process.terminate()
|
self.process.terminate()
|
||||||
thread.join()
|
thread.join()
|
||||||
return False, 255
|
return False, 255
|
||||||
|
Loading…
x
Reference in New Issue
Block a user