8 #include <oatpp-websocket/WebSocket.hpp>
10 #include <tbb/mutex.h>
18 const oatpp::websocket::WebSocket& conn,
22 Json::StreamWriterBuilder builder;
23 builder[
"indentation"] =
"";
24 const std::string text = Json::writeString(builder, msg);
28 conn.sendOneFrameText(text.c_str());
30 catch (
const std::exception& e)
34 session.
addLog(std::string(
"WebSocket send failed: ") + e.what());
41 session.
addLog(
"WebSocket send failed: unknown exception");
uint64_t messagesSent
Definition: webLVCClientSession.h:195
tbb::mutex mutex
Definition: webLVCClientSession.h:31
bool DtWebLvcSendJson(const oatpp::websocket::WebSocket &conn, DtWebLvcClientSession &session, const Json::Value &msg)
Serialize msg as compact JSON and deliver it to the WebSocket connection. Increments session...
Definition: webLVCHelpers.h:17
Template around a TBB Mutex lock which adds a tracy marker when the lock is waiting on the mutex...
Definition: tracyLocks.h:12
void addLog(const std::string &message)
Definition: webLVCClientSession.h:209
IMGUI_API void Value(const char *prefix, bool b)
uint64_t bytesSent
Definition: webLVCClientSession.h:197
bool connected
Definition: webLVCClientSession.h:34
WebLVC Client Session - Tracks state for each connected client per SISO-STD-017-2022 Section 5...
Definition: webLVCClientSession.h:28