mirror of
https://github.com/Palakis/obs-websocket.git
synced 2024-08-30 18:12:16 +00:00
server: use std::string in broadcast
This commit is contained in:
parent
11617eea99
commit
40e2d410dd
@ -222,7 +222,7 @@ void WSEvents::broadcastUpdate(const char* updateType,
|
|||||||
obs_data_apply(update, additionalFields);
|
obs_data_apply(update, additionalFields);
|
||||||
|
|
||||||
QString json = obs_data_get_json(update);
|
QString json = obs_data_get_json(update);
|
||||||
_srv->broadcast(json);
|
_srv->broadcast(json.toStdString());
|
||||||
|
|
||||||
if (Config::Current()->DebugEnabled)
|
if (Config::Current()->DebugEnabled)
|
||||||
blog(LOG_DEBUG, "Update << '%s'", json.toUtf8().constData());
|
blog(LOG_DEBUG, "Update << '%s'", json.toUtf8().constData());
|
||||||
|
@ -100,7 +100,7 @@ void WSServer::stop()
|
|||||||
blog(LOG_INFO, "server stopped successfully");
|
blog(LOG_INFO, "server stopped successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
void WSServer::broadcast(QString message)
|
void WSServer::broadcast(std::string message)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(&_clMutex);
|
QMutexLocker locker(&_clMutex);
|
||||||
for (connection_hdl hdl : _connections) {
|
for (connection_hdl hdl : _connections) {
|
||||||
@ -110,7 +110,7 @@ void WSServer::broadcast(QString message)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_server.send(hdl, message.toStdString(), websocketpp::frame::opcode::text);
|
_server.send(hdl, message, websocketpp::frame::opcode::text);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ public:
|
|||||||
virtual ~WSServer();
|
virtual ~WSServer();
|
||||||
void start(quint16 port);
|
void start(quint16 port);
|
||||||
void stop();
|
void stop();
|
||||||
void broadcast(QString message);
|
void broadcast(std::string message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static WSServerPtr _instance;
|
static WSServerPtr _instance;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user