mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
More ifdefs!!!
This commit is contained in:
@ -43,8 +43,12 @@ using websocketpp::lib::bind;
|
|||||||
|
|
||||||
WSServer::WSServer()
|
WSServer::WSServer()
|
||||||
: QObject(nullptr),
|
: QObject(nullptr),
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
_connections(),
|
_connections(),
|
||||||
_clMutex(QMutex::Recursive)
|
_clMutex(QMutex::Recursive)
|
||||||
|
#else
|
||||||
|
_connections()
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
_server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control);
|
_server.get_alog().clear_channels(websocketpp::log::alevel::frame_header | websocketpp::log::alevel::frame_payload | websocketpp::log::alevel::control);
|
||||||
_server.init_asio();
|
_server.init_asio();
|
||||||
@ -227,7 +231,7 @@ void WSServer::onMessage(connection_hdl hdl, server::message_ptr message)
|
|||||||
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
|
||||||
QtConcurrent::run(&_threadPool, [=]() {
|
QtConcurrent::run(&_threadPool, [=]() {
|
||||||
#else
|
#else
|
||||||
_threadPool::run([=]() {
|
_threadPool.start([=]() {
|
||||||
#endif
|
#endif
|
||||||
std::string payload = message->get_payload();
|
std::string payload = message->get_payload();
|
||||||
|
|
||||||
|
@ -21,7 +21,11 @@ with this program. If not, see <https://www.gnu.org/licenses/>
|
|||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
|
#else
|
||||||
|
#include <QRecursiveMutex>
|
||||||
|
#endif
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QVariantHash>
|
#include <QVariantHash>
|
||||||
#include <QThreadPool>
|
#include <QThreadPool>
|
||||||
@ -70,6 +74,11 @@ private:
|
|||||||
bool _lockToIPv4;
|
bool _lockToIPv4;
|
||||||
std::set<connection_hdl, std::owner_less<connection_hdl>> _connections;
|
std::set<connection_hdl, std::owner_less<connection_hdl>> _connections;
|
||||||
std::map<connection_hdl, ConnectionProperties, std::owner_less<connection_hdl>> _connectionProperties;
|
std::map<connection_hdl, ConnectionProperties, std::owner_less<connection_hdl>> _connectionProperties;
|
||||||
|
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||||
QMutex _clMutex;
|
QMutex _clMutex;
|
||||||
|
#else
|
||||||
|
QRecursiveMutex _clMutex;
|
||||||
|
#endif
|
||||||
|
|
||||||
QThreadPool _threadPool;
|
QThreadPool _threadPool;
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user