minor improvements (#66)
* minor improvements * fix build * improve tests code
This commit is contained in:
committed by
Benjamin Sergeant
parent
4934f5846b
commit
2254421ead
@ -148,6 +148,8 @@ namespace ix
|
||||
|
||||
if (_thread.joinable())
|
||||
{
|
||||
// wait until working thread will exit
|
||||
// it will exit after close operation is finished
|
||||
_stop = true;
|
||||
_thread.join();
|
||||
_stop = false;
|
||||
@ -361,10 +363,10 @@ namespace ix
|
||||
}
|
||||
}
|
||||
|
||||
WebSocketSendInfo WebSocket::send(const std::string& text,
|
||||
WebSocketSendInfo WebSocket::send(const std::string& data,
|
||||
const OnProgressCallback& onProgressCallback)
|
||||
{
|
||||
return sendMessage(text, SendMessageKind::Binary, onProgressCallback);
|
||||
return sendMessage(data, SendMessageKind::Binary, onProgressCallback);
|
||||
}
|
||||
|
||||
WebSocketSendInfo WebSocket::sendText(const std::string& text,
|
||||
|
@ -106,7 +106,8 @@ namespace ix
|
||||
WebSocketInitResult connect(int timeoutSecs);
|
||||
void run();
|
||||
|
||||
WebSocketSendInfo send(const std::string& text,
|
||||
// send binary data
|
||||
WebSocketSendInfo send(const std::string& data,
|
||||
const OnProgressCallback& onProgressCallback = nullptr);
|
||||
WebSocketSendInfo sendText(const std::string& text,
|
||||
const OnProgressCallback& onProgressCallback = nullptr);
|
||||
|
@ -6,9 +6,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
|
||||
namespace ix
|
||||
{
|
||||
struct WebSocketSendInfo
|
||||
|
@ -719,7 +719,7 @@ namespace ix
|
||||
bool compress,
|
||||
const OnProgressCallback& onProgressCallback)
|
||||
{
|
||||
if (_readyState == CLOSING || _readyState == CLOSED)
|
||||
if (_readyState != OPEN)
|
||||
{
|
||||
return WebSocketSendInfo();
|
||||
}
|
||||
|
@ -4,7 +4,6 @@
|
||||
* Copyright (c) 2019 Machine Zone, Inc. All rights reserved.
|
||||
*/
|
||||
#include "../IXSetThreadName.h"
|
||||
#include <iostream>
|
||||
#include <Windows.h>
|
||||
|
||||
namespace ix
|
||||
|
Reference in New Issue
Block a user