add a way to run in blocking more, which is useful for server mode to have N*thread instead of 2N*thread for N connections

This commit is contained in:
Benjamin Sergeant
2019-01-01 21:25:15 -08:00
parent 946d7015a2
commit 1bc5bc7f1c
5 changed files with 54 additions and 18 deletions

View File

@ -250,6 +250,8 @@ TEST_CASE("Websocket chat", "[websocket_chat]")
ix::msleep(10);
}
REQUIRE(server.getClients().size() == 2);
// Add a bit of extra time, for the subscription to be active
ix::msleep(200);
@ -269,6 +271,10 @@ TEST_CASE("Websocket chat", "[websocket_chat]")
REQUIRE(chatA.getReceivedMessagesCount() == 2);
REQUIRE(chatB.getReceivedMessagesCount() == 3);
// Give us 500ms for the server to notice that clients went away
ix::msleep(500);
REQUIRE(server.getClients().size() == 0);
ix::reportWebSocketTraffic();
}
}

View File

@ -2,6 +2,6 @@
mkdir build
cd build
cmake ..
make
cmake .. || exit 1
make || exit 1
./ixwebsocket_unittest