patching writePolicy into cmd_stream, assuming we

want writePolicy to govern both relayIngest and stream

I really hate spam, is what I'm trying to say.
This commit is contained in:
Bonn Ortloff
2023-03-27 18:24:41 -05:00
parent e5ec135e78
commit 2308276af5
4 changed files with 21 additions and 4 deletions

View File

@ -25,6 +25,8 @@ class WSConnection {
std::function<void()> onTrigger;
bool reconnect = true;
uint64_t reconnectDelayMilliseconds = 5'000;
// bortloff@github needed an address to work with here, for his stream writepolicy hack
std::string connected_addr;
// Should only be called from the websocket thread (ie within an onConnect or onMessage callback)
void send(std::string_view msg, uWS::OpCode op = uWS::OpCode::TEXT, size_t *compressedSize = nullptr) {
@ -59,6 +61,7 @@ class WSConnection {
std::string addr = ws->getAddress().address;
LI << "Connected to " << addr;
connected_addr = addr;
{
int optval = 1;