unittest fix

This commit is contained in:
Benjamin Sergeant 2019-01-24 19:54:10 -08:00
parent e9cd54b2f4
commit ea219e3ddd
2 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,11 @@ Here is what the client API looks like.
ix::WebSocket webSocket; ix::WebSocket webSocket;
std::string url("ws://localhost:8080/"); std::string url("ws://localhost:8080/");
webSocket.configure(url); webSocket.setUrl(url);
// Optional heart beat, sent every 45 seconds when there isn't any traffic
// to make sure that load balancers do not kill an idle connection.
webSocket.setHeartBeatPeriod(45);
// Setup a callback to be fired when a message or an event (open, close, error) is received // Setup a callback to be fired when a message or an event (open, close, error) is received
webSocket.setOnMessageCallback( webSocket.setOnMessageCallback(

View File

@ -178,7 +178,7 @@ TEST_CASE("Websocket_heartbeat", "[heartbeat]")
{ {
ix::setupWebSocketTrafficTrackerCallback(); ix::setupWebSocketTrafficTrackerCallback();
int port = 8091; int port = 8092;
ix::WebSocketServer server(port); ix::WebSocketServer server(port);
std::atomic<int> serverReceivedPingMessages(0); std::atomic<int> serverReceivedPingMessages(0);
REQUIRE(startServer(server, serverReceivedPingMessages)); REQUIRE(startServer(server, serverReceivedPingMessages));