(apple ssl) model write method after the OpenSSL one for consistency

More test code for #140.
This commit is contained in:
Benjamin Sergeant
2020-01-10 18:32:34 -08:00
parent 0544cdedeb
commit 9651f3823d
11 changed files with 124 additions and 23 deletions

View File

@ -241,7 +241,7 @@ namespace ix
{
std::vector<uint8_t> content;
{
Bench bench("load file from disk");
Bench bench("ws_send: load file from disk");
content = load(filename);
}
@ -257,9 +257,12 @@ namespace ix
MsgPack msg(pdu);
Bench bench("Sending file through websocket");
auto serializedMsg = msg.dump();
spdlog::info("ws_send: sending {} bytes", serializedMsg.size());
Bench bench("ws_send: Sending file through websocket");
auto result =
_webSocket.sendBinary(msg.dump(), [this, throttle](int current, int total) -> bool {
_webSocket.sendBinary(serializedMsg, [this, throttle](int current, int total) -> bool {
spdlog::info("ws_send: Step {} out of {}", current + 1, total);
if (throttle)
@ -283,6 +286,8 @@ namespace ix
return false;
}
spdlog::info("ws_send: sent {} bytes", serializedMsg.size());
do
{
size_t bufferedAmount = _webSocket.bufferedAmount();