🐛 Fix socket deadlock

This commit is contained in:
Rune Harlyk
2025-11-27 17:38:51 +01:00
parent 6c61227623
commit ffb2bc8749
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -38,15 +38,15 @@ class CommAdapterBase {
array.add(event);
array.add(payload);
// TODO: Only send to subscribed
#if USE_MSGPACK
std::string bin;
serializeMsgPack(doc, bin);
send(reinterpret_cast<const uint8_t *>(bin.data()), bin.size(), -1); // TODO: Make CID dynamic
xSemaphoreGive(mutex_);
send(reinterpret_cast<const uint8_t *>(bin.data()), bin.size(), -1);
#else
String out;
serializeJson(doc, out);
xSemaphoreGive(mutex_);
send(out.c_str(), -1);
#endif
}
@@ -10,7 +10,7 @@
#include <communication/comm_base.hpp>
class Websocket : CommAdapterBase {
class Websocket : public CommAdapterBase {
public:
Websocket(PsychicHttpServer &server, const char *route = "/api/ws");